Page 1 of 1

Bars are missing on single X category with Side option

Posted: Tue Jul 24, 2012 4:01 pm
by 7667590
Hi,

I created a simple pareto chart, and I found a bug; I noticed that bars (after the first bar) are missing when I have multiple bars on the same X category with marks labels being displayed and with MultiBars.SIDE. Is there a fix for this?

here is run as it is to illustrate the problem above

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);
		
		StringList labelsList;

		Bar blueSeries = new Bar(chart.getChart());
		blueSeries.setMultiBar(MultiBars.SIDE);
		blueSeries.add(0, 10, "A");
		labelsList = new StringList(1);
		labelsList.add(0, "10");		
		blueSeries.setLabels(labelsList);
		blueSeries.getMarks().setVisible(true);
		blueSeries.setTitle("blue series");
		
		Bar redSeries = new Bar(chart.getChart());
		redSeries.setMultiBar(MultiBars.SIDE);
		redSeries.add(0, 20, "A");
		labelsList = new StringList(1);
		labelsList.add(0, "20");
		redSeries.setLabels(labelsList);
		redSeries.getMarks().setVisible(true);
		redSeries.setTitle("red series");
		
		//custom x label
		chart.getAxes().getBottom().getCustomLabels().clear();
		chart.getAxes().getBottom().getCustomLabels().add(0.0, "A");

		chart.getAspect().setView3D(false);
		
		frame.add(panel);
		frame.setSize(600, 600);
		frame.setVisible(true);
	}

Re: Bars are missing on single X category with Side option

Posted: Fri Jul 27, 2012 8:26 am
by yeray
Hi Jonathan,

This is what I'm getting with your code:
Bars.png
Bars.png (25.47 KiB) Viewed 15948 times
I don't see what's wrong. I understand this is the result I'd expect with your code: Two side bars with one point each one. Their labels are "A" and "B" when you add the points, then you change them to "10" and "20". And you finally use custom labels in the bottom axis to just show a "A" at the 0.
Could you please explain again what result would you expect?

Re: Bars are missing on single X category with Side option

Posted: Fri Aug 03, 2012 4:33 pm
by 7667590
Hi Yeray,

Your chart is exactly what I expect to see. However, for some reasons, I am not getting that chart, but the following instead: (With Teechart V2 version and TeeChartJavaSuite_2012Eval.zip, I am seeing the same result - missing bars [missing red series in the sample codes]) I attached mine: Could you tell me what is missing/wrong?

Re: Bars are missing on single X category with Side option

Posted: Mon Aug 06, 2012 11:12 am
by yeray
Hi Jonathan,

Please, attach the whole testing application (clean, export and zip it, if you are in eclipse) so we see if there's something we've missed.

Re: Bars are missing on single X category with Side option

Posted: Mon Aug 06, 2012 3:14 pm
by 7667590
Hi Yeray,

Since the max. allowed size is 512 KB, I had to remove the lib file. I attached the whole testing application (using Eclipse) in zip. What version of teechart lib were you using? Was it same one as mine (version2) ?

Re: Bars are missing on single X category with Side option

Posted: Wed Aug 08, 2012 12:01 pm
by yeray
Hi Jonathan,

Thanks to your application I could reproduce it. It seems it only happens in the swing version.
I've added it to the defect list to be revised asap.