All Projects → AlbinoDrought → chartjs-plugin-downsample

AlbinoDrought / chartjs-plugin-downsample

Licence: MIT license
Chart.js plugin to downsample chart data

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to chartjs-plugin-downsample

chartjs-plugin-datasource-prometheus
Chart.js plugin for Prometheus data loading
Stars: ✭ 77 (+87.8%)
Mutual labels:  chartjs
chart
📊📉 Add beautiful and reusable charts with one line of ruby for Rails 5.x
Stars: ✭ 42 (+2.44%)
Mutual labels:  chartjs
chartjs-chart-graph
Chart.js Graph-like Charts (tree, force directed)
Stars: ✭ 103 (+151.22%)
Mutual labels:  chartjs
Voice4Rural
A complete one stop solution for all the problems of Rural area people. 👩🏻‍🌾
Stars: ✭ 12 (-70.73%)
Mutual labels:  chartjs
dashblocks-template
Dashblocks Vue Material Admin Template
Stars: ✭ 143 (+248.78%)
Mutual labels:  chartjs
Chart.js-Rounded-Bar-Charts
Rounded Rectangles in Bar Charts
Stars: ✭ 48 (+17.07%)
Mutual labels:  chartjs
Integrating-Chart-Js-in-Angular-7
Check out Integrating ChartJs in Angular 7 in DotNet Techy YouTube Channel
Stars: ✭ 16 (-60.98%)
Mutual labels:  chartjs
chartjs-web-components
the web components for chartjs
Stars: ✭ 50 (+21.95%)
Mutual labels:  chartjs
charts
Laravel Enso Charts is a VueJS, wrapper for Chart.js, with a backend data builder, so you can add beautiful charts to your application
Stars: ✭ 15 (-63.41%)
Mutual labels:  chartjs
data-11ty
An open source 11ty theme designed for reporting & data-visualization
Stars: ✭ 19 (-53.66%)
Mutual labels:  chartjs
Ticket-Travel-Management-System
It's a e_Ticketing platform, it has whole ticket reservation system as like ixigo.com. Now three types of traveling such as Flight, Bus and Train reservation system. It's a responsive and dynamic PHP website.
Stars: ✭ 39 (-4.88%)
Mutual labels:  chartjs
github-user-languages
Browser extension that adds little language pie charts to a user's profile page on GitHub.
Stars: ✭ 41 (+0%)
Mutual labels:  chartjs
chartjs-chart-timeline
Google-like timeline chart for Chart.js.
Stars: ✭ 44 (+7.32%)
Mutual labels:  chartjs
nova-chartjs
A Chart JS component for Laravel Nova
Stars: ✭ 47 (+14.63%)
Mutual labels:  chartjs
PiFire
PiFire is a Smart WiFi enabled controller for your pellet smoker / grill.
Stars: ✭ 41 (+0%)
Mutual labels:  chartjs
chartjs-plugin-piechart-outlabels
Highly customizable Chart.js plugin that displays labels outside the pie/doughnut chart.
Stars: ✭ 46 (+12.2%)
Mutual labels:  chartjs
competiwatch-desktop
Desktop app built in Electron for tracking your competitive match history in Overwatch.
Stars: ✭ 94 (+129.27%)
Mutual labels:  chartjs
competiwatch
Web app to track and visualize your competitive match history in Overwatch.
Stars: ✭ 17 (-58.54%)
Mutual labels:  chartjs
hugo-chart
a Chart.js component for Hugo. 📈
Stars: ✭ 71 (+73.17%)
Mutual labels:  chartjs
phpchartjs
A PHP library that makes it easy to generate data for ChartJS.
Stars: ✭ 24 (-41.46%)
Mutual labels:  chartjs

chartjs-plugin-downsample

Plugin for downsampling data in Chart.js, based off of sveinn-steinarsson/flot-downsample.

NPM

Samples

Configuration

The configuration for this plugin lives in chartInstance.options.downsample. This looks like the following while setting up your chart:

{
    options: {
        downsample: {
            enabled: true,
            threshold: 500 // max number of points to display per dataset
        }
    }
}

Additional Options

Option Default Description
auto true If true, downsamples data automatically every update. Otherwise, chart will have to be manually downsampled with .downsample()
onInit true If true, downsamples data when the chart is initialized.
restoreOriginalData true If true, replaces the downsampled data with the original data after each update. This is, mainly, for compatibility with other plugins.
preferOriginalData false If true, downsamples original data instead of data. This option can clash with dynamically-added data. If false, data cannot be "un-downscaled".
targetDatasets [] An array of dataset IDs that you want to downsample. If empty or not set, downsamples all datasets.

Methods

Method Description
chartInstance.downsample(var threshold = null) Manually downsamples the data on the given chart. If a threshold is passed, updates the threshold in the chart config to the given value.

Optimal Performance

This plugin was created because of performance issues while loading lots of data in a chart with pan/zoom capabilites.

If options are not changed from their defaults, data will be downsampled every time the user pans or zooms - this is probably not what you want. For a more performant configuration, try this:

{
    options: {
        downsample: {
            enabled: true,
            threshold: <YOUR THRESHOLD HERE>, // change this

            auto: false, // don't re-downsample the data every move
            onInit: true, // but do resample it when we init the chart (this is default)

            preferOriginalData: true, // use our original data when downscaling so we can downscale less, if we need to.
            restoreOriginalData: false, // if auto is false and this is true, original data will be restored on pan/zoom - that isn't what we want.
        }
    }
}

Building

npm run build will generate a browser-ready chartjs-plugin-downsample.js and chartjs-plugin-downsample.min.js

License

chartjs-plugin-downsample is released under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].