..at Plot.getSeriesPaint().
Happens when there are no sereis points specified (i.e. their are no currently selected series) so the mod operator breaks.
btw, _very_ nice work; we are using JFreeChart to replace commercial software whihch will allow us to make a more public release. _Much_ cleaner api than Sitarka's. Hopefully we will be able to contribute something at some point.
Bug report: divide by zero..
Re: Bug report: divide by zero..
Hi Miles,
In the Plot constructor, the seriesPaint array is initialised with 9 default colors. That never gets changed, so I'm guessing that somewhere you must have called setSeriesPaint(...) and supplied an empty array, which wouldn't be a good thing to do. I could put some code in setSeriesPaint(...) to ensure that the array is non-empty...or did I misunderstand the problem?
Regards,
DG.
In the Plot constructor, the seriesPaint array is initialised with 9 default colors. That never gets changed, so I'm guessing that somewhere you must have called setSeriesPaint(...) and supplied an empty array, which wouldn't be a good thing to do. I could put some code in setSeriesPaint(...) to ensure that the array is non-empty...or did I misunderstand the problem?
Regards,
DG.
Re: Bug report: divide by zero..
Yea, I'm writing to setSeriesPaint with the colors that I would like to be dispalyed for each series. that's the only way I could figure out to set specific colors. (I tried overriding getSeriesPaint in my dataset, but that didn't seem to do anything.)
So anyway, in the case where _no_ series are currently selectex for display, this does get set to an empty array; i.e., there are no series being painted so you shouldn't need to get at the paint for any series. As a work around, I am now setting this to {Color.white} in the case where there are no series being displayed.
I build framewroks myself, so I know the frustration of someone doing an end-run around the preffered method! Probaably I'm just missing something about the right way to do this.
So anyway, in the case where _no_ series are currently selectex for display, this does get set to an empty array; i.e., there are no series being painted so you shouldn't need to get at the paint for any series. As a work around, I am now setting this to {Color.white} in the case where there are no series being displayed.
I build framewroks myself, so I know the frustration of someone doing an end-run around the preffered method! Probaably I'm just missing something about the right way to do this.
Re: Bug report: divide by zero..
I think you are right, if there are no series then there shouldn't be any code trying to get the seriesPaint...I'll see if I can find out what is happening.
Regards,
DG.
Regards,
DG.