I have implemented some special renderer implementations and today I noticed that the renderer internal RendererState object is not initialized separately for each dataset. This is quite painful because I save some informations in this object which is only valid for one dataset. With the current implementation I cannot detect inside Renderer.drawItem(..) if I still render the same dataset like before or if this is the first call with a new dataset. item==0 does not work anymore because the current XYPlot implementation sometime does not start rendering at item 0 for performance reasons
Let me give an example what I want to do with the RenderState:
Supposed I have a dataset with lots of xy values. Now it is possible that the dataset contains 10 different y values that are rendered a the same x pixel coordinate (not value - I really mean pixel). This causes the renderer to draw a long vertical line from the lowest to highest y value at the same x pixel. My specialized renderer now should draw not each y value separately but a mean value of them. So I only have in maximum one render point at one x pixel coordinate. If I zoom in then I will get all y values in more detail.
Puuuuh, Saving of the values at the same x coordinate now must be done in the RenderState object. And data values of two different datasets should not be mixed. Therefore I need something like a reset() or triggerNewDataset() method for the RenderState object.
Please ask if you don't completely understand what I want. It's really complex and it dives very deep into the internals of freechart.