How to change visibilty with BarRenderer ?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
onderulker
Posts: 13
Joined: Mon May 22, 2006 3:01 pm

How to change visibilty with BarRenderer ?

Post by onderulker » Wed Nov 29, 2006 3:11 pm

Hi all,

I have a chart like that,
http://docs.google.com/View?docid=ddw99tpn_57fgmvbs

In some cases I want to make the series unvisible. I have tried with

renderer.setSeriesVisible(new Boolean(false)); and
renderer.setSeriesVisible(0,new Boolean(false)); functions

but I could not do this.

Is there any one who could explain right way?

Regards,

Onder.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Nov 29, 2006 5:16 pm

Not all renderers respect the 'seriesVisible' flags yet, and BarRenderer is one of them, so there isn't an easy way to do this yet. The hard way is to remove the series from the dataset entirely (assuming you are using a dataset that supports removing a series - otherwise you could create a whole new dataset and replace the old one), and redraw the chart.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

vani_hegde
Posts: 17
Joined: Tue Oct 11, 2005 9:27 pm

setting visiblity

Post by vani_hegde » Wed Nov 29, 2006 9:22 pm

Does StackedXYAreaRenderer2 respect Series visibility flag?

thanks,
vani

onderulker
Posts: 13
Joined: Mon May 22, 2006 3:01 pm

Post by onderulker » Thu Nov 30, 2006 2:15 pm

Thanks David.

I havent got any idea about StackedXYAreaRenderer but I have tried this with 'StackedBarRenderer' and 'StackedBarRenderer3D' and the result was negative.

Am I right? Is it possible with StackedBarChart ?

Regards,

Onder.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Nov 30, 2006 3:25 pm

None of the bar renderers or stacked renderers supports this yet. It is a little more difficult to implement for these cases, because hiding one series actually changes the location of other series. I'll take another look at it...
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked