Case 1) When I set the labels starting from index 0, my labels("one","two","three") are displaying correctly. However, x axis labels are replaced by the custom labels, which should NOT be happened. Right?
Case 2) [Since Case1 does not work, I tried the following.] When I set the labels starting from index 1, x axis labels and displaying the labels work fine, except the 1st point since i set the label starting from index 1, instead of 0.
My Question is Why "case 1" doesn't work correctly? Is this a bug?? Or How can I fix this problem?
Here is the code for "Case1"
Code: Select all
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);
Points p = new Points(chart.getChart());
p.add(3,6);
p.add(4,7);
p.add(5,10);
StringList sl = new StringList(3);
if(true){
sl.setString(0, "one");
sl.setString(1, "two");
sl.setString(2, "three");
}
p.setLabels(sl);
if(true){
MarksTip mt = new MarksTip(chart.getChart());
mt.setStyle(MarksStyle.LABEL);
}
frame.add(panel);
frame.setSize(600, 600);
frame.setVisible(true);
}
Code: Select all
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);
Points p = new Points(chart.getChart());
p.add(3,6);
p.add(4,7);
p.add(5,10);
StringList sl = new StringList(3);
if(true){
sl.setString(1, "one");
sl.setString(2, "two");
sl.setString(3, "three");
}
p.setLabels(sl);
if(true){
MarksTip mt = new MarksTip(chart.getChart());
mt.setStyle(MarksStyle.LABEL);
}
frame.add(panel);
frame.setSize(600, 600);
frame.setVisible(true);
}