Downsample plugin for Flot charts.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Adding article by Riccardo Binetti May 6, 2018
demo_data.js Initial commit May 14, 2013
example.css Initial commit May 14, 2013
example.html Downsampling to downsample Nov 19, 2013
example.js Initial commit May 14, 2013
jquery.flot.downsample.js Version jump to 1.0 (original version seems pretty stable) Nov 19, 2013

README.md

flot-downsample: Downsample plugin for Flot

This plugin for Flot charts 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 or LTTB) 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

Demo can viewed at flot.base.is.

Additional demo concerning chart resizing is also available at flot.base.is/demo-resize

Usage

series: {
  downsample: {
    threshold: 1000 // 0 disables downsampling for this series.
  }
}

Known limitations

  • Does not support gaps (null values) in the data array.
  • X-values must be in a strictly increasing order.

Articles about the algorithm (LTTB)

The algorithm (LTTB) adapted for other programming languages or frameworks

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.)

License

flot-downsample is released under the terms of the MIT License.