- Author: Sveinn Steinarsson
- Special thanks: Borgar Þorsteinsson and DataMarket
This plugin for Highcharts downsamples data before rendering the chart. The purpose is to try retain the visual characteristics of the original line using considerably fewer data points. The algorithm (called Largest-Triangle-Three-Buckets) used in this plugin is described in a Master's thesis (see hdl.handle.net/1946/15343) in Computer Science by Sveinn Steinarsson at the University of Iceland. The topic of the thesis is how to downsample time series for visual representation and was initially suggested by DataMarket. JavaScript optimization was done with the help of Borgar Þorsteinsson.
Demo can viewed at highcharts.base.is.
Additional demo is also available in JSFiddle
series: [{
downsample: {
threshold: 1000 // 0 disables downsampling for this series.
},
data: // Your data (array of arrays with two values or array of numerical values)
}]
This plugin is mainly for downsampling line charts but might work for other types, e.g. area or column. The recommended input data format is array of arrays with two values. Array of numerical values is also supported but might be slower. Array of objects and range series are not supported!
- Does not support gaps (null values) in the data array.
- X-values must be in a strictly increasing order.
- The Challenge of Metrics Visualization by Mark Troyer
- Downsampling data – Not a trivial task by DataMarket
- Sampling large datasets in d3fc by William Ferguson
- C# by Daniel Judge
- C# by Adrian Seeley
- node.js by Matej Drolc
- Java by drcrane
- Scala by Graham Tackley
- R by Jack Viljoen
- Javascript (without the flot plugin) by Josh Carr
- Flot Plugin by Sveinn Steinarsson
- PHP by dbojdo
- [Python] (https://github.com/devoxi/lttb-py) by Olivier Devoisin
- [Perl] (https://github.com/troxel/LargestTriangleThreeBuckets) by troxel
- [C++ Qt] (https://github.com/temap/misc/blob/master/src/lttb.hpp) by Artyom Panfilov
Note: I have not tested all these versions and some might have different or additional features.
(Please let me know if you make your own port of the LTTB algorithm so I can list it here.)
highcharts-downsample is released under the terms of the MIT License.