Chartjs-Chart js: How to select a rectangular area with the mouse

1๐Ÿ‘

I was able to do the selection using the drag feature of Chart js. This is what I did:

plugins: {
    zoom: {
        enabled: true,
        mode: 'xy',
        zoom: {
            wheel: {
                enabled: true
            },
            pinch: {
                enabled: true
            },
            drag: {
                enabled: true,
                backgroundColor: 'rgba(255, 99, 132, 0.2)',
                borderColor: 'rgb(255, 99, 132)',
                borderWidth: 1,
                modifierKey: 'ctrl'
            },
        },
        pan:{
            enabled: true,
            mode: 'xy'
        }
    }

Leave a comment