increment, max and min for axis
Posted: 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
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