areski / django-nvd3

Django wrapper for nvd3 - It's time for beautiful charts
Other
416 stars 124 forks source link

data container and performance #17

Open zebulon2 opened 10 years ago

zebulon2 commented 10 years ago

Hi, I am testing lineChart and was wondering how to pass a lot of data time courses without impairing too much the performance. I have seen that the data is passed as a list in the header of the rendered HTML page. I would like to have a dozen xy curves displayed, and this leads to some strain on the client side. Any advice on compressing/increasing performance (except reducing the resolution)? Thanks in advance.

areski commented 10 years ago

Actually I even investigated this, it will be interesting to share what you found. Maybe looking at what the folks from nvd3 recommend would be a good start.

zebulon2 commented 10 years ago

Alright, will share. Interestingly, Google charts does not have the same performance issue. But there are less functionalities (like toggling the time course curves from the legend).

zebulon2 commented 10 years ago

The Ramer-Douglas-Peucker algorithm works pretty well to simplify lines. However, I understand that a line chart with several line series must have the same 'x' axis values, am I correct? Or is there a way to display line charts with different 'x' series? If not, then I need to apply the rdp algorithm to each series, take all the reduced 'x' together and reconstruct the series.

areski commented 10 years ago

Thanks for the pointer, that sounds a very interesting algorithm. It's possible to use different x axis for each line, I just pushed an example how to do that

areski commented 10 years ago

https://github.com/areski/python-nvd3/commit/0c782e9f53293d7640241ef5258bad0a3347f203

zebulon2 commented 10 years ago

Hi, many thanks, did not know it was possible, this simplifies the problem a lot. However, there seems to be a problem with nvd3 performance for multiple series. Flot, for instance, has absolutely no problem to display 6 overlays of 8 series of 1000 points on any major browser, with point coordinates display when hovering above the series courses. 1 serie with nvd3 makes FF and Chrome struggle, and IE crashes. I understand that nvd3 is having a major rewrite (version 2) so this may be corrected. But I need to report the issue upstream.