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
Bad Performance with large Series (tooltip specifically) #4093
Comments
There may be two reasons for the issue, first performance in the business code computing the tooltip, but more likely it's an issue with rendering the SVG fast enough on top of a complex SVG structure. That is a common browser problem.
|
@highslide-software we already use HTML tooltip, and by the way, even dropping the tooltip altogether and just having a crosshair is very slow. and the profiler shows its a rendering/draw latency. here is our options: the canvas experiment is just amazing, drawing 0.5m points in no time. why isn't there an option to fallback to canvas as first class citizen in highcharts options? |
We have been discussing this option, and we may also add it to the core. We imagine that it can drop in when the
|
I can't even begin to express how important I think that is. Even if you don't support I.E. this is something our customers can leave with vs. slow charts that are not responsive at all. Even if I consider taking your demo and working with it, it will take me quite some time to have it running with all other functionality (tooltip and other events will be enough). So this is not an option to me, it will be easier to customize flot charts instead IMHO. Please find the compromise (it wont be that bad) as not having support for (not that large > 2k datapoints) large series. I understand that working with a third party tooltip, from you experience will not get me any closer? |
I've done some work on this approach now, and made great progress by copying the PNG data of the canvas directly into an SVG image tag. See the current implementation in this fiddle. Improvements:
|
Wow, this is amazing I see that series show/hide also works. I am a bit confused about the responsiveness is/should be done in order that the chart will fit in the container (when resizing the window or the container), and of course the zoom in. It seems to me this is something possible for a near future release. Other wise i can fall into many pitfalls overriding these series prototypes functions... can you think of any pitfalls in advance? none the less i think this should be an integral part of the product |
I now added support for zooming and resizing, and probably most other cases of redrawing. See d55d84c.
There's still much work to be done, for example each series type needs its own optimized drawGraph function as well as perhaps drawPoints. And probably we should be able to define levels of optimizing, for example if you have 500,000 points, it is expensive to find the data min and max, but not so much with 10,000 points.
Oh yes, plenty. We have bypassed extremes calculation, data cropping, data grouping in Highstock and even
I agree to that. We could add optimize: {
threshold: 1000,
autoExtremes: false,
enableTooltip: true
} |
Our use of highcharts in our app is very intense. We use it for dashboards, investigating large time series data graph and monitoring. So basically we use many kind of series types and enable our customers to change these types on the fly. So after reading your last comment I realize I will/may loose much functionality (series types, stacking options) since the nature of the solution is overriding the highcharts prototype. Regarding the zoom, the drag gesture is nearly enough since we translate it to a server zoom. But just so you know, zooming to ~100 points in the chart the tooltip starts to get an offset for some points from their original position. The other thing is that we use hchart.xAxis[0].translate to draw a crosshair synchronized between charts. I'm not sure that would work also
The optimize feature is exactly what I was looking for in the first place. I'm not sure enableTooltip should take part of it since this option already exists in the tooltip itself. The 'threshold' option on the other had is good , but then I ask my self why do I need the SVG option in the first place? And what am I loosing here? Probably we cannot answer this right now. 'autoExtremes' is also good if it will enable me to have better performance. I also think this should be part of the chart options (across all series). |
Great. I've pushed another commit which fixes the tooltip issue when zoomed in. Also improved the performance with built-in extremes calculation, so we can skip axis min and max options now.
I would prefer SVG paths in smaller series because it
Also, SVG performs just as well with less than a few thousand points. See https://cloud.highcharts.com/show/atijef. A reasonable threshold form optimizing would be between 1000 and 10,000 points. To summarize, I think the feature is best implemented as a module (like drilldown and exporting etc) which is part of the official API, but not part of the
What do you think? |
I see your point regarding SVG, and I cannot argue the animation case, or having DOM manipulations abilities, nor the time investment already made. Exporting is an asynch operation with no tooltip or other interactions, so falling back to SVG is more than possible. On the other hand you get canvas client export options if you care less for 'ever-sharp' graphics… so for users like myself, that have already disabled any chart animation the canvas option is the way to go, which leads me to another question: im not sure how your plugin system operates. Does it override or extends the existing functionality? Will it misbehave with other plugins? Will it be supported in all major and minor releases? By the way, thank you for the SVG canvas comparison! But I remind you that the coast was interacting with the chart (tooltip) and not the loading time, which is something that end-users can coop with (with a little UX help) regarding the series type: (if not mentioned I agree with your point of view)
Ill check you commit during the weekend |
My proposal was to create a Highcharts module, which is part of our documented API, tests, docs etc. A plugin is a more loose, often third party piece of code.
That's the downside of throwing an error. You set up a dynamic service, and suddenly an end user throws in 11,000 points and it breaks. On the other hand, making this and integrated part of the On the other hand, we already have thresholds like this. For example, point configurations given as objects don't work when you have more than 1000 points of data, and will throw an error if you try. So the new proposal is just an exact continuation of that. See http://api.highcharts.com/#plotOptions.series.turboThreshold.
According so some of our users, the loading time is also a problem. Also, we want to look good on side-by-side tests compared to competitors.
|
Ok |
We're making progress on https://github.com/highslide-software/highcharts.com/blob/b432c9475e419d3780f13dd3903ade437fbd3d69/js/modules/series-on-canvas.experimental.src.js. Line and scatter are working nicely now. I'll have a look at arearange now. |
First draft of an arearange with half a million points: http://jsfiddle.net/highcharts/a129eret/. What do you think? |
This is amazing, since the progress seems very rapid we decided to wait for highcharts implementations before moving to other solutions… Here are my comments:
|
Thanks! Yes, we will finish this path now. We're already on a good way to a full implementation.
I made the drawing async, so that it now draws 50,000 points, does a timeout, draws another 50,000 points etc. That way we avoid locking up the user thread, so the browser will be responsive while drawing. The showLoading call is here.
Exporting actually worked before I made the async refactoring. That's because the canvas image is encoded inside the SVG, so the export server treats it as a bitmap. The only thing we need to fix is to wait for all chunks to be rendered.
Yes, we should find a way to avoid that. Also when zooming in, then zooming out to full view, we should avoid redrawing everything. A possible solution is to cache the whole canvas contents and restore when showing/zooming out. |
I think we are on the right track, One thing that is important to consider here is the fact that we have ~10 charts minimum on a page. with infinite scrolling we can have more. so resizing is an issue, though it is minor please keep me up to date |
I think this would be very useful for us as well. We have a dynamically-updated StockChart with 200K-1M points, updating at ~3 points/sec. We also have I love how performant the canvas demo is, great work on that! Using canvas would solve a lot of issues for us. Is there a plan to get this working with HighStock and dynamic charts too? |
Thanks @vickychijwani !
|
@highslide-software great progress, the highstock seems to crash when changing the dates from the slider. series updating looks great, the tooltip seems to do a good job sliding over the chart when mouse moves... is there a roadmap for next version? |
The data in series update example gets distorted as soon as I move my mouse pointer over it. It seems to be caused by |
One drawback of canvas seems to be that redrawing frequently is much more expensive than with SVG, probably because we're redrawing an entire PNG every time? Starting with 4000 points and completely zoomed out, each call to |
What is the status of this issue? What is the roadmap? |
We are still working on this, and we published a news article on the matter
in order to invite the public to test it. See
http://www.highcharts.com/component/content/article/2-news/175-highcharts-performance-boost
.
|
Ok, i would appreciate a version number or a timeline if that comes along. |
Since the addition of zones in 4.1 We are planing to refactor our code to use this feature. Will it be supported in the boost module? |
@highslide-software : 👍 for having this included. Much needed feature. Any update on the progress? |
We are currently working on Highcharts 5, so for the time being the Boost
module will stay in Beta. But we will respond to bug reports on it, and
encourage people to use it, as long as they test their applications well
across browsers.
|
@highslide-software looks like much great progress was made towards a solution, but the issue remains open. Any update? |
Yes, we're fixing bugs on the Boost module, so if you have specific issues we can have a look. |
@chrisgervang just for the reference, please see this: #5223 |
The recent boost overhaul introduced in 5.0.8 should address several of the above concerns. You should see a significant performance boost (no pun intended) both with the rendering itself, and things like tooltips and so on. |
I have faced performance issue for tooltip for large heatmap after upgrading to the Highchart 5.0.11. So I have used the boost module and found that performance issue has gone but new issue has got created where the color does not plot correctly. I have mentioned the same in the https://forum.highcharts.com/highcharts-usage/canvas-solution-for-long-heatmap-chart-t38375/ post. |
Color does plot correctly, but it looks like tooltip is rendered for a wrong point. In your screenshot you can see in tooltip: 70.13 -> so it's correct color, but wrong point. Short gif: Edit: I see it's reported as #6981. |
Please check the following JS Fiddle which behaves correctly which has same code but only difference is boost module is not included. You can see clear difference in the color plotted on charts with respect to mentioned JS Fiddle in issue. |
This has been fixed (see #6981). |
Hi,
We have been straggling with highcharts performance for long time now with no good results, and i would like to explore my options regarding.
assumptions:
I want to know if the following work around will have any affect:
Thank you
The text was updated successfully, but these errors were encountered: