sveinn-steinarsson / highcharts-downsample Goto Github PK
View Code? Open in Web Editor NEWDownsample plugin for Highcharts.
Downsample plugin for Highcharts.
Looks like something has changed either in highcharts core library or plugin handler.
The below fiddle fails to downsample:
http://jsfiddle.net/6meqb9d0/33/
I need to be able to use navigator and custom buttons to zoom into data.
I noticed threshold setting is applied for entire data set length, so while zoomed I need to calculate desirable threshold points count... And hook into setExtremes event to update series objects.
But it seems when doing Point update and redrawing the chart, new threshold value doesn't apply? I perhaps need to resort into removing and inserting new series' to chart...
var calcZoomedDownsampleThreshold = function(dataMin, dataMax, min, max) {
var verticalPixels = window.innerWidth - 120;
if ( ! _.isUndefined(dataMin) && ! _.isUndefined(dataMax) && ! _.isUndefined(min) && ! _.isUndefined(max) ) {
var dataSpanSeconds = Math.floor((dataMax - dataMin) / 1000),
zoomSpanSeconds = Math.floor((max - min) / 1000);
console.log(Math.round(verticalPixels * dataSpanSeconds / zoomSpanSeconds));
return Math.round(verticalPixels * dataSpanSeconds / zoomSpanSeconds);
} else {
return verticalPixels;
}
};
xAxis: {
type: 'datetime',
events: {
setExtremes: function (e) {
chart.series[0].update({ downsample: { threshold: calcZoomedDownsampleThreshold(this.dataMin, this.dataMax, e.min, e.max) } }, false);
chart.series[1].update({ downsample: { threshold: calcZoomedDownsampleThreshold(this.dataMin, this.dataMax, e.min, e.max) } }, false);
chart.redraw();
}
}
},
Hello Sveinn,
First of all, thanks for sharing your work on LTTB algorithm. It is exactly what I am looking for to plot large data size in Microsoft Chart Component. Here is the link to my implementation in GitHub MSChartExtension/DownSampling.cs.
On top of that, I made some further improvement to address the limitation of your original LTTB algorithm to take into consideration with data with non fixed X. I wrote the description of the changes here: Implementation of Downsampling Algorithm in MSChart Extension
I would like to seek your kindness to review and comment on my work.
I am appreciate if my work is up to standard to be listed in your list of LTTB adaptation.
Should you have any questions, you can also contact me at [email protected].
Hope to hear from you soon.
Regards,
Code Artist
First off, thanks a lot for this plugin and your work on downsampling.
I've used your plugin extensively and just recently experienced a issue with it:
When downsampling discrete time series (series with null values) the gaps sometimes get sampled out. The desired functionality would be for null values to go untouched so gaps in the series are displayed correctly.
I am using your plugin to Downsample chart data. However, I am not able to figure out on downsampling data when a point is added to the chart.
Need help on this http://jsfiddle.net/FMJAL/86/
Regards,
Ashwin
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.