Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boosts module with Highstock and dataGrouping #5160

Closed
KacperMadej opened this issue Mar 29, 2016 · 17 comments
Closed

Boosts module with Highstock and dataGrouping #5160

KacperMadej opened this issue Mar 29, 2016 · 17 comments

Comments

@KacperMadej
Copy link

I guess "Check how it works with Highstock and data grouping." is part of "Development plan" of the module, so there is an issue - some times it doesn't work with data grouping.

If data is (force) grouped, but boostThreshold is still exceeded, then browser hangs and if you get lucky it will unfreeze and throw errors like "max stack exceeded".
Example: http://jsfiddle.net/n9j1s74a/
Steps: increase n to 12e4 and hit run (there will be 5001 grouped points)

@TorsteinHonsi
Copy link
Collaborator

Note that navigator.adaptToUpdatedData is also required to prevent freeze: http://jsfiddle.net/highcharts/n9j1s74a/1/

@cbaket
Copy link

cbaket commented Mar 31, 2016

Hi,

what happens when you set units to: ['minute', [1]] with your example http://jsfiddle.net/cbaket/n9j1s74a/3/ ??
If you set ['minute', [30]] it works (very slow, but it works).

I made a new example where there are points every 1 minute, and less points http://jsfiddle.net/cbaket/n9j1s74a/4/ and here it works, but if you change and add points every 1 hour (change line in 'getData' function) it crashes.

Thanks ;)

@TorsteinHonsi
Copy link
Collaborator

Sorry, I didn't use the fixed version of boost.js in my fiddle. It simply disables data grouping because we don't need it in boost, it just adds extra computing. See http://jsfiddle.net/highcharts/n9j1s74a/5/.

@cbaket
Copy link

cbaket commented Mar 31, 2016

Ok, but now you can't use dataGrouping ...
If you set dataGrouping units to ['year', [1]] it doesn't group. ?¿?
So we can not use dataGrouping if boost module is used ?

Thanks ;)

@TorsteinHonsi
Copy link
Collaborator

That's correct. It could probably be done, but the chart will render faster if we just skip the data grouping and let the sampling be up to the boost module.

@cbaket
Copy link

cbaket commented Apr 4, 2016

Hi,

First of all, thank you very much for your quick and usefull answers!! 👍 .

In my project I need to import boost module because some times there are charts with many points and without boost.js it's too slow (and with Firefox the tooltip is very very slow).
The problem is that it's up to the user to set dataGrouping (enabled/disabled, approximation and forced )

So if we have a chart with one point every day, and user sets dataGrouping to 1 hour(or 1 minute) and there are many points, it will crash.
You said: It could probably be done.
Is there any way to do this ?

Thanks!!!

@TorsteinHonsi
Copy link
Collaborator

The thing is that data grouping defeats the purpose of the boost module. The data grouping is designed to increase perfomance by sampling the data into larger groups, so that we have less data to handle. The boost module also increases performance by sampling data, but does so more aggressively and at a lower level.

But by running data grouping, the data is already down-sampled, so the boost module has nothing more to do. Therefore is is best to disable data grouping to let the much faster boost module do its work.

@RolandBanguiran
Copy link

Hi Torstein,

I'm not sure if this is the right place to ask. But does this Boost.js module works with candlesticks? Currently we are having issue with performance when displaying too much stocks historical price data.

Thanks.

@TorsteinHonsi
Copy link
Collaborator

Hi Roland, currently the boost module does not work with candlesticks.

@RolandBanguiran
Copy link

Hi Torstein, Thanks for the reply. I hope this will come available with all series type in the future.

By the way, any plan to create an all-canvas in future Highcharts version?

@cbergmiller
Copy link

So just by including the boost module data grouping is disabled for all charts?
What do i do when i just want to use the boost module for a large heatmap while still rendering other stock charts in standard SVG mode?
Is there any way to turn off the boost module completely for some charts?
(I understand that the boost module is experimental - i just want to make shure i got it right..)

@TorsteinHonsi
Copy link
Collaborator

Is there any way to turn off the boost module completely for some charts?

Sure!

To set it on the whole chart, set boost.enabled to false.

For individual series, set the series.boostThreshold option to something big.

@cbergmiller
Copy link

While boost.enabled = false allows to disable rendering with the boost module, it still turns off data grouping of the navigator series. This causes performance issues with large data-sets (e.g. xAxis.setExtremes taking too long).
Is this the intended behavior or should i create an issue?

@TorsteinHonsi
Copy link
Collaborator

Can you set navigator.series.boostThreshold to something big to prevent it?

@cbergmiller
Copy link

No, navigator.series.boostThreshold set to a high value (or Number.MAX_VALUE) doesn't seem to enable data grouping on a stock chart when the boost module is loaded but disabled.

@pawelfus
Copy link
Contributor

pawelfus commented Oct 6, 2017

Internal note:
It looks like Series.prototype.allowDG is always set to true when loading boost.js, that prevents all series from grouping. Additionally, dataGrouping checks result from processData(), but boost removes return ... in the processData wrap. Note that setting allowDG to true, won't resolve issue, because boost checks somewhere series.points and assumes it is an array or undefined, but in Highstock it can be set to null.

@TorsteinHonsi
Copy link
Collaborator

This is fixed now in the master branch. The boost module shouldn't alter the series properties unless it is actually boosting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants