X-axis increment, min and max
Posted: Mon Aug 18, 2008 7:01 pm
Hi,
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.steema.teechart.TChart;
import com.steema.teechart.styles.FastLine;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.setSize(600, 600);
TChart chart = new TChart();
panel.add(chart);
FastLine fastLine = new FastLine(chart.getChart());
for (int i = 0; i < 12; i++) {
if ((i != 3) && (i != 7))
fastLine.add(i * i, " " + i);
}
//comment for first run
chart.getAxes().getBottom().setAutomatic(false);
chart.getAxes().getBottom().setIncrement(2.0);
chart.getAxes().getBottom().setMaximum(22.0);
chart.getAxes().getBottom().setMinimum(2.0);
//end of comment
frame.add(panel);
frame.setSize(600, 600);
frame.setVisible(true);
}
}
Do you think that the example program given above is working fine ?
Please run the program by commenting out the axis labels related settings first and for the second run use it as it is.
Thanks,
Varun
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.steema.teechart.TChart;
import com.steema.teechart.styles.FastLine;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.setSize(600, 600);
TChart chart = new TChart();
panel.add(chart);
FastLine fastLine = new FastLine(chart.getChart());
for (int i = 0; i < 12; i++) {
if ((i != 3) && (i != 7))
fastLine.add(i * i, " " + i);
}
//comment for first run
chart.getAxes().getBottom().setAutomatic(false);
chart.getAxes().getBottom().setIncrement(2.0);
chart.getAxes().getBottom().setMaximum(22.0);
chart.getAxes().getBottom().setMinimum(2.0);
//end of comment
frame.add(panel);
frame.setSize(600, 600);
frame.setVisible(true);
}
}
Do you think that the example program given above is working fine ?
Please run the program by commenting out the axis labels related settings first and for the second run use it as it is.
Thanks,
Varun