Setting series as visible/invisible and setting range axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sandrider
Posts: 9
Joined: Thu Apr 27, 2006 6:40 am

Setting series as visible/invisible and setting range axis

Post by sandrider » Mon Jul 10, 2006 7:06 am

I have 2 questions.

Question 1
I have used the source codes for the XYBarChartDemo4. I have succeeded in changing the colour of the individual plots (I have 3 series in 1 collection).

plot.getRenderer().setSeriesPaint(2, Color.gray);

I'd like to make the series visible/invisible depending on the user but when I do a
plot.getRenderer().setSeriesVisible(0, false);

I get an error message "The method setSeriesVisible(int, Boolean, boolean) in the type XYItemRenderer is not applicable for the arguments (int, boolean)"

Question 2
I want to remove the marking for the range axis (y axis) and only display the max, how can I do that?

Thanks.

Desmond

atomic
Posts: 1
Joined: Thu Jul 20, 2006 7:44 am

setSeriesVisible does not work with some Renderer

Post by atomic » Thu Jul 20, 2006 8:09 am

I have a program which allow user choose which series is actually visible on my chart.
I tried making the series invisible/visible by using method setVisible(index, boolean) for some different Renderers, they are: LineAndShapeRenderer, BarRenderer, Bar3DRenderer, and StackedBarRenderer.
And I noticed that Only LineAndShapeRenderer worked correctly.

So what can I do to make the others renderers work as correctly as LineAndShapeRender does?

Currently, I'm using version 1.0.0. So which version will fix the above bug?

Thanks a lot.
Regards.

Locked