Page 1 of 1

increment, max and min for axis

Posted: Fri Sep 12, 2008 7:22 pm
by 7667591
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

Posted: Mon Sep 15, 2008 9:12 am
by narcis
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.