Hi Guys,
just a basic and very simple question: Does the DefaultPolarItemRenderer/PolarItemRenderer support the setSeriesVisible(index,boolean) method of AbstractRenderer? And if not, is it possible to realize that as a patch?
Looking forward to your answers:)
DefaultPolarItemRenderer setSeriesVisible
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: DefaultPolarItemRenderer setSeriesVisible
A look in the source of DefaultPolarItemRenderer suggests that this renderer does not care about the series or item visibility. You probably have to extend DefaultPolarItemRenderer and overwrite both getItemVisible() to return a suitable boolean and the drawSeries-Methode to use this flag.
Re: DefaultPolarItemRenderer setSeriesVisible
Thank you for your answer!
I thought about extendig the DefaultPolarItemRenderer but don't know how... Do you have an example or little code snippet of how to do that?
I thought about extendig the DefaultPolarItemRenderer but don't know how... Do you have an example or little code snippet of how to do that?
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: DefaultPolarItemRenderer setSeriesVisible
I have never worked with the Polar-classes. A look ih the source suggests that the drawSeries-Method of DefaultPolarItemRenderer does the actual rendering.
if you want to hide an entire series, you could check for the visibility of the series at the beginning of this method:
To hide individual items, you would have to override getItemVisible(int, int)and wrap the block between line 511 and 520 in an if-block
if you want to hide an entire series, you could check for the visibility of the series at the beginning of this method:
Code: Select all
if(!isSeriesVisible(seriesIndex)) return;
Code: Select all
if(getItemVisible(seriesIndex, i)){
double theta = dataset.getXValue(seriesIndex, i);
double radius = dataset.getYValue(seriesIndex, i);
....
}
Re: DefaultPolarItemRenderer setSeriesVisible
Seems to be simple...
So do I have to decompile the JFreeChart-Library to modify the source code? Or is there a better way?
(I never had to modify a library before....)
So do I have to decompile the JFreeChart-Library to modify the source code? Or is there a better way?
(I never had to modify a library before....)
Re: DefaultPolarItemRenderer setSeriesVisible
It wooooorks!! Thank you:)PatrickN wrote:Seems to be simple...
So do I have to decompile the JFreeChart-Library to modify the source code? Or is there a better way?
(I never had to modify a library before....)
Just added
Code: Select all
if(!isSeriesVisible(seriesIndex)) return;
To modify the library I created a new (eclipse) project based on the source-files of jfreechart.