My highchart diagram is loading extremely slow due to large amount of data (one data per day for the past 10 years). I already turned off the animation. And it is still slow. Is there a way to speed up or performance improvement to allow faster loading time and able to zoomed in without any lags? Thanks.
The webpage with the highchart is only 77kb though.
You can use dataGrouping and set enableMouseTracking to false.
enableMouseTracking: Boolean
Enable or disable the mouse tracking for a specific series. This includes point tooltips and click events on graphs and points. When using shared tooltips (default in stock charts), mouse tracking is not required. For large datasets it improves performance. Defaults to true.
Update
Found the following on it's docs.
How can I get the best performance out of Highcharts?
When working with series with a high number of data points, there are a few things to consider.
For line plots, it is recommended that you disable point markers, as these will add a performace overhead. See http://highcharts.com/demo/line-time-series.
Disabling shadows increases performance, as three shadow elements are created for each shape that includes a shadow.
For large column series, it is recommended that you disable the initial animation, plotOptions.column.animation, at least for VML based browsers. The best way to distinguish between fast SVG browsers and slower VML browsers is to use the Highcharts.svg boolean property.
Reference
enableMouseTracking
dataGrouping
FAQ
Related
I created a TeeChart with two TContourSeries: One with filled set to false and one set to true. Both get exactly the same data and both are not active while feeding the data to them.
When I activate the not filled series it takes less than a second to paint itself. Not so the filled series. It takes at least 10 times longer to draw itself.
Why is that so? I would imagine that the filled series uses the same algorithm as the not filled one and then some sort of flood fill is used. That should not take that long.
Is there a way to speed up painting of the series in filled mode? Data reduction is not an option here.
I'm copying the reply from here.
I'm afraid the filling of the contour series isn't so simple as one could think at a first glance.
We are internally using a TIsoSurface to draw the cells, which makes the process slower.
Some references:
https://www.steema.com/support/viewtopic.php?f=3&t=12326
https://www.steema.com/support/viewtopic.php?f=3&t=10796
http://bugs.teechart.net/show_bug.cgi?id=1438
I have a scenario where the user can pick up to 5 different data sets to be included at one time. These data sets have vastly different scales (one might be from 0-100 while another could be 500-6000, and so on). These data sets are sensor readings (temperature, PH, etc.).
They all share a common x-axis in that each data set has different points across time, which is the x-axis. In addition to this, I want to correlate all of these different data sets with another data set that is basically a set of activities that happened at certain points in time, so I want to be able to say "for each event, what were the different sensor readings at that time" in a nice, graphical way.
What would be the best type of graph in highcharts to be able to display these? Obviously, a regular line graph doesn't work because of the different scales. A dual axis chart isn't enough. I've been playing around with a bunch of different stuff, but I haven't found anything that looks good.
So, I've been playing around with Core Plot (iOS, version 1.5) to see how well I can integrate into my app. I'm testing it on an iPad 3, which is usually my base device for graphics.
Instead of pasting a ton of code, here's the plot configuration:
1 Graph, using the Plain White Theme
1 Plot Space
2 Separate Scatter Plots, 3 data points per plot.
2 Axis:
XAxis: Range: Dec 2013, Mar 2014 (NSTimeInterval). 3 Labels, 3 Major Ticks and about 90 minor ticks (1 per day)
YAxis: Range: 0, 250. 3 Labels, 3 Major Ticks, 12 minor Ticks. YAxis Floats on Right side of graph.
Each Axis has 1 Title
So, generally my app sits at around 33-34 mb usage. It may spike up to 50 mb if displaying a few images, but generally it'll sit within the 33-34 mb range. However, loading up Core Plot jumps the memory to around 63 mb. If I enable scaling and pinch on the graph to scale it or I simply drag the graph around, memory usage spikes to ~ 143 mb and then settles back to 84mb. When I close the graph, memory drops to about 22mb, which I assume is because other caches have been cleared due to memory pressure.
Also, maybe related, pinching and dragging the graph is remarkably slow. Maybe averaging 2-3 FPS with drops to 2 SPF (seconds per frame...seriously).
It looks like Core Plot is taking an obscene amount of memory and is horribly slow.
Am I missing something or is this just the way Core Plot is? Unless I can speed this up and use a lot less memory, there's just no way I can use Core Plot in production.
Update
I have profiled my app using Instruments. There's not too much to say here except that all of the memory gain is in Core Plot objects (or derived from them). The Time Profiler shows that when I resize or move the plot, most of the time is being spent in one of various core plot rendering methods originating from a drawInContext: method. Ironically, the first line in that method is self.useFastRendering = YES;.
I will add that the plot is almost full screen. I have a couple other controls to edit Plot fields, graph type, etc, but that's it.
To be honest, I was kind of hoping I'd miss some kind of property related to performance, but that doesn't seem to be the case. Core Plot is probably fine for static graphs, but it lags behind in interactivity and performance.
I spent some time looking over the Shinobi Controls and checking out their iOS demo. This is exactly the kind of interactivity & performance I want in my graphs. But I'm leery about including expensive, closed, 3rd-party code in my app...
Likely I will spend time creating my graphs by hand.
Unfortunately Core plot is a very slow library which can only handle a few hundred data-points before memory and CPU usage gets out of hand.
There were other chart components which were able to handle big data much more efficiently. Have a look at https://stackoverflow.com/a/45589678/303612 for more info
In my app, i got core plot bar chart on a scroll view with paging, on IPhone all work fine , you page between different pages, one of them is the plot with its own touch gestures and properties.
Problem starts when i run the same code on IPad. plot becomes slow and laggy, all touch gestures takes a lot of time to response and the whole scroller paging becomes heavy and slow.
the chart itself contains 100 points or so (not so big).
I've read somewhere that the change of plot space between IPhone and IPad makes these changes in performance because the IPad renders 4 times the graphics. Did anybody had this problem before? Is there something i can do to make performance better on IPad without limit or lose preform data?
Unfortunately Core plot is a very slow library which can only handle a few hundred data-points (or less in some cases).
I wrote an answer here which describes a performance comparison between iOS chart components. One of the charts tested was core-plot and it couldn't do the first test!
Without knowing the specifics of your app, here are some general performance hints:
Set all line styles and fills that you don't need to nil rather than transparent colors.
Use solid color fills rather than gradients or images where possible.
Reduce the number of axis labels, tick marks, and grid lines if possible. Perhaps eliminate minor tick marks and grid lines completely (set the corresponding line styles to nil).
Only call -reloadData when a significant portion of the plot data changes. Use the insert and delete methods when possible. See the "Real Time Plot" in the Plot Gallery example app.
I have a simple scatter plot with ~500,000 points on it. Having this many points on the graph really makes my app lag, which isn't surprising. I was wondering if there was a way to only draw the points for a specific x range (like 0-100 or 500-1000). The user will only be looking at certain points of the graph (via zooming in), so it would make it much less laggy if the program only had to plot a small amount of those points.
I've tried having the graph re-draw itself, every time the user zooms in/out or moves the axis, but this actually seems to make the app run slower. Is there a solution to this issue?
You'll have to filter the data and only provide the visible points to the plot in your datasource. Use a plot space delegate to detect when the visible area changes and adjust the data as needed. The best way to do this will depend on how your app stores its data internally. You'll want to use a data structure that lets you quickly determine which points need to be plotted.
You don't want to reload all of the data every time something changes. The plots have methods to insert and remove ranges of data points while preserving the rest of the data. If you're only changing a few points at a time, this is much faster than reloading all of the data every time. The "Real-Time Plot" demo in the Plot Gallery app shows one way to use these methods.