Hi I want to show/hide the series in my graph and i am using
XYITemRenderer.setSeriesVisisble(int seriesNum, Boolean visible, true)
This works fine in case of line graphs, but in the case where we use the
StackedXYAreaRenderer2, it is not working, the series still shows, even when i set the setSeriesVisible to false.
Does anyone knows why? What is the solution?
thanks,
vani
Setting the series visbility
I am having the same issue http://www.jfree.org/phpBB2/viewtopic.php?t=11819. However, I'm not getting much in the way of help.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The listener notification is just a way of telling anyone that is interested that the chart's appearance is likely to have changed...the default setup triggers a chain of events that results in the chart itself firing a ChartChangeEvent. If you have your chart displayed in a ChartPanel, the panel listens for ChartChangeEvents and repaints the chart whenever such an event is received. There is nothing to fix in this part of the code (with respect to series visibility).
The series visibility flags *should* be observed by all renderers, but so far not all renderers do this. I've fixed a couple more in CVS (ready for the 1.0.4 release), but have to do more work to make the stacked renderers do this correctly (because making one series invisible can change the position in which the other series get rendered). There is also a subtle bug in the stacked area renderers that I'm working on...I think the fix for that should make it much easier to hide/display individual series, and I think this should be done for the 1.0.4 release (which will most likely be in January).
The series visibility flags *should* be observed by all renderers, but so far not all renderers do this. I've fixed a couple more in CVS (ready for the 1.0.4 release), but have to do more work to make the stacked renderers do this correctly (because making one series invisible can change the position in which the other series get rendered). There is also a subtle bug in the stacked area renderers that I'm working on...I think the fix for that should make it much easier to hide/display individual series, and I think this should be done for the 1.0.4 release (which will most likely be in January).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

