XYItemRenderer too slow - why not draw all points at once?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
havfrue
Posts: 29
Joined: Mon Nov 03, 2003 4:49 pm

XYItemRenderer too slow - why not draw all points at once?

Post by havfrue » Mon Jun 14, 2004 3:28 pm

XYItemRenderer uses drawItem method for drawing points...

Why isn't there a draw items("whole array at once") renderer method that instead of using the dataset is using
input as arrays (double[] xValues and double[] yValues)

Alternatively, when datasets are very large there should be two methods in the dataset
public double[] getXValues(int serie)
public double[] getYValues(int serie)
that could be used in a new "line" renderer.

The reason why I am asking all these questions regarding rendering of large datasets is that I might be forced to use some other charting technology if I am not able to optimize my Jfreechart charts. I really like jfreechart ... except the problems I run into when I have large datasets.

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 » Mon Jun 14, 2004 5:05 pm

I've avoided these kinds of optimisations because I didn't want JFreeChart to get locked in to any particular data structure. The approach you suggest can work, but it only really makes sense if the data is already stored in arrays (which isn't always true).

One approach that might work is to add your proposed methods to a FastXYDataset interface that extends XYDataset. Dataset classes could then choose whether or not to implement the additional methods, and renderers could check for the existence of the "fast" interface and use it if it is available. I think this would require only a small change to the XYPlot class.

I'm not going to have time to try this out for a little while though, I'll be on holiday for a couple of weeks starting next week.
David Gilbert
JFreeChart Project Leader

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

Locked