I'm using StockChart with an attached AxisSetExtremesEventHandler for lazy loading.
Each time the data is reloaded I create a new Series and add it to the Chart. The series includes about 360 Points with x as long and y as double.
Everything works fine and is fast enough except the redraw of the chart, which takes about 11000ms!!!
Any suggestions?
I wrote the same example using pure JavaScript, and it takes about less than a second.
The particular method in GWT Highcharts that you're profiling there (Chart.redraw()) simply just makes a call to the Highcharts.redraw() JS method. So, the only time spent would be inside of the Highcharts JS library itself.
Are you running this test in GWT's dev mode, or fully compiled mode?
Couple of other notes on your code example:
If it's possible for your application, I believe Highcharts is more efficient at simply updating the data of a series (e.g. Series.setPoints()), rather then removing all the series and recreating them.
If you do need to add a series to the chart after it has been rendered, it's more efficient to add the points to the series first and then add the series to the chart. (So, in your code example you'd want to flip the "s.setPoints()" and "chart.addSeries()" lines.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using StockChart with an attached AxisSetExtremesEventHandler for lazy loading.
Each time the data is reloaded I create a new Series and add it to the Chart. The series includes about 360 Points with x as long and y as double.
Everything works fine and is fast enough except the redraw of the chart, which takes about 11000ms!!!
Any suggestions?
I wrote the same example using pure JavaScript, and it takes about less than a second.
Here is what I do in Java
The particular method in GWT Highcharts that you're profiling there (Chart.redraw()) simply just makes a call to the Highcharts.redraw() JS method. So, the only time spent would be inside of the Highcharts JS library itself.
Are you running this test in GWT's dev mode, or fully compiled mode?
Couple of other notes on your code example:
If it's possible for your application, I believe Highcharts is more efficient at simply updating the data of a series (e.g. Series.setPoints()), rather then removing all the series and recreating them.
If you do need to add a series to the chart after it has been rendered, it's more efficient to add the points to the series first and then add the series to the chart. (So, in your code example you'd want to flip the "s.setPoints()" and "chart.addSeries()" lines.)