0.0.6 • Published 3 years ago

chartjs-plugin-zoom-fetch v0.0.6

Weekly downloads
12
License
MIT
Repository
gitlab
Last release
3 years ago

chartjs-plugin-zoom-fetch

Installation

You can install the plugin using the npm:

npm install chartjs-plugin-zoom-fetch

Usage

Example code on how to use this plugin:

import Chart from 'chart.js'
import ZoomFetchPlugin from 'chartjs-plugin-zoom-fetch'

// Register plugin
Chart.plugins.register(ZoomFetchPlugin)

// Plugin options
const options = {
    plugins: {
        zoomFetch: {
            /** 
             * Callback that is called on zoom selection end
             * @param {Object} from: x-axis value from
             * @param {Object} to: x-axis value to
             */
            onZoom: function(from, to){
                // Implementation
            },

            // If set to true, the sellection height will always be same as the chart area height
            snapToChart: false
        }
    }
}

// Create Chart as usual
... 
0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago