score:1

Accepted answer

chartjs-plugin-streaming v1.6.0 now supports chartjs-plugin-zoom.

include chart.js, chartjs-plugin-zoom.js, chartjs-plugin-streaming.js and required libraries (moment.js and hammer.js), and add pan and zoom options. note that unlike other scale types, the rangemin and rangemax options don't specify time values. instead, pan.rangemin and pan.rangemax limit the range of the delay option value while zoom.rangemin and zoom.rangemax limit the range of the duration option value.

options: {
    // assume x axis is the realtime scale
    pan: {
        enabled: true,    // enable panning
        mode: 'x',        // allow panning in the x direction
        rangemin: {
            x: null       // min value of the delay option
        },
        rangemax: {
            x: null       // max value of the delay option
        }
    },
    zoom: {
        enabled: true,    // enable zooming
        mode: 'x',        // allow zooming in the x direction
        rangemin: {
            x: null       // min value of the duration option
        },
        rangemax: {
            x: null       // max value of the duration option
        }
    }
}

Related Query

More Query from same tag