increment, max and min for axis

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Chen
Newbie
Newbie
Posts: 43
Joined: Tue Mar 11, 2008 12:00 am
Contact:

increment, max and min for axis

Post by Chen » Fri Sep 12, 2008 7:22 pm

Hi,

Sorry to say that I am really confused with setIncrement, setMaximum and setMinimum for axis. It does not work as expected.

package com.amd.ngeda.chart.gallery.teechart;

import javax.swing.JFrame;
import javax.swing.JPanel;

import com.steema.teechart.TChart;
import com.steema.teechart.styles.FastLine;

public class TestTeeChart {

public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.setSize(600, 600);
TChart chart = new TChart();
chart.getAxes().getBottom().getLabels().setValueFormat("0.00E0");
panel.add(chart);
FastLine fastLine = new FastLine(chart.getChart());
for (int i = 0; i < 100; i++) {
fastLine.add(i, i * i);
}

chart.getAxes().getBottom().setAutomatic(false);
chart.getAxes().getBottom().setIncrement(10);
chart.getAxes().getBottom().setMaximum(200.0);
chart.getAxes().getBottom().setMinimum(1.0);

frame.add(panel);
frame.setSize(600, 600);
frame.setVisible(true);
}
}


If you run the program then you will see that only setmaximum is applied to the chart. One more thing which I noticed was the issue with large values for increment. If we set large values for increment then all the axis labels are disappearing from the chart.

Could you please explain me the concept of increment, min and max ?

Thanks,
Varun

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Sep 15, 2008 9:12 am

Hi Varun,
If you run the program then you will see that only setmaximum is applied to the chart.
That's not true, you'll see the difference if you use this:

Code: Select all

        chart.getAxes().getBottom().setMinimum(10.0);

One more thing which I noticed was the issue with large values for increment. If we set large values for increment then all the axis labels are disappearing from the chart.
This happens when you manually set an increment larger than the axis range.
Could you please explain me the concept of increment, min and max ?
You'll find information about this in Tutorial 4 - Axis Control. Tutorials can be found at TeeChart's "Docs" folder.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply