Line chart x axis labels repeating
Posted: Wed Oct 08, 2008 6:26 pm
Hi,
package com.amd.ngeda.chart.teechart;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.steema.teechart.TChart;
import com.steema.teechart.styles.Line;
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);
// [(1), (3), (10)]
// [(1), (2), (3), (10)]
// [(1), (3)]
// [(1), (2), (3), (4), (7), (8), (9), (10)]
// [(1), (2), (3), (7), (10), (15)]
// [(1), (2), (3), (10)]
// [(1), (2), (3), (10)]
// [(1), (3), (4)]
// [(1), (2), (3), (4), (7), (10)]
// [(1), (2), (3), (4), (7), (8), (10)]
// [(1), (2), (3), (10)]
// [(1), (2), (3), (4), (7), (10)]
// [(1), (2), (3), (4), (10), (15)]
//
//
Line fastLine = new Line(chart.getChart());
fastLine.add(2, ""+1);
fastLine.add(3, ""+3);
fastLine.add(4, ""+10);
Line fastLine11 = new Line(chart.getChart());
fastLine11.add(1, ""+1);
fastLine11.add(3, ""+2);
fastLine11.add(8, ""+3);
fastLine11.add(4, ""+10);
Line fastLine1 = new Line(chart.getChart());
fastLine1.add(10, ""+1);
fastLine1.add(20, ""+3);
Line fastLine4 = new Line(chart.getChart());
fastLine4.add(10, ""+1);
fastLine4.add(20, ""+2);
fastLine4.add(20, ""+3);
fastLine4.add(20, ""+4);
fastLine4.add(20, ""+7);
fastLine4.add(20, ""+8);
fastLine4.add(20, ""+9);
fastLine4.add(20, ""+10);
Line fastLine5 = new Line(chart.getChart());
fastLine5.add(10, ""+1);
fastLine5.add(20, ""+2);
fastLine5.add(20, ""+3);
fastLine5.add(20, ""+10);
fastLine5.add(20, ""+15);
frame.add(panel);
frame.setSize(600, 600);
frame.setVisible(true);
}
}
If you run this code then you will find that x axis contains duplicate labels.
I want to use add(double, String) in my code and I do not want to see duplicate labels. Is this a bug or feature ????? OR AM I DOING SOMETHING WRONG ? Any help would be appreciated.
Thanks,
Varun
package com.amd.ngeda.chart.teechart;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.steema.teechart.TChart;
import com.steema.teechart.styles.Line;
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);
// [(1), (3), (10)]
// [(1), (2), (3), (10)]
// [(1), (3)]
// [(1), (2), (3), (4), (7), (8), (9), (10)]
// [(1), (2), (3), (7), (10), (15)]
// [(1), (2), (3), (10)]
// [(1), (2), (3), (10)]
// [(1), (3), (4)]
// [(1), (2), (3), (4), (7), (10)]
// [(1), (2), (3), (4), (7), (8), (10)]
// [(1), (2), (3), (10)]
// [(1), (2), (3), (4), (7), (10)]
// [(1), (2), (3), (4), (10), (15)]
//
//
Line fastLine = new Line(chart.getChart());
fastLine.add(2, ""+1);
fastLine.add(3, ""+3);
fastLine.add(4, ""+10);
Line fastLine11 = new Line(chart.getChart());
fastLine11.add(1, ""+1);
fastLine11.add(3, ""+2);
fastLine11.add(8, ""+3);
fastLine11.add(4, ""+10);
Line fastLine1 = new Line(chart.getChart());
fastLine1.add(10, ""+1);
fastLine1.add(20, ""+3);
Line fastLine4 = new Line(chart.getChart());
fastLine4.add(10, ""+1);
fastLine4.add(20, ""+2);
fastLine4.add(20, ""+3);
fastLine4.add(20, ""+4);
fastLine4.add(20, ""+7);
fastLine4.add(20, ""+8);
fastLine4.add(20, ""+9);
fastLine4.add(20, ""+10);
Line fastLine5 = new Line(chart.getChart());
fastLine5.add(10, ""+1);
fastLine5.add(20, ""+2);
fastLine5.add(20, ""+3);
fastLine5.add(20, ""+10);
fastLine5.add(20, ""+15);
frame.add(panel);
frame.setSize(600, 600);
frame.setVisible(true);
}
}
If you run this code then you will find that x axis contains duplicate labels.
I want to use add(double, String) in my code and I do not want to see duplicate labels. Is this a bug or feature ????? OR AM I DOING SOMETHING WRONG ? Any help would be appreciated.
Thanks,
Varun