Skip to content

Using chartjs-plugin-zoom with angular ng2-charts #615

@alfabetagama

Description

@alfabetagama

When using zoom plugin with angular ng2 charts, you have to explicitly set wheel.speed and pan.threshold for pan and wheel zoom to work. If those are not set in plugin options those functions won't work.
ng2-charts 3.0.8
chart.js 3.0.3

This works:

zoom: {
    zoom: {
        wheel: {
            enabled: true,
            speed: 0.3,
        },
        pinch: {
            enabled: true,
        },
        drag: {
            enabled: false,
        },
        mode: 'x',
    },
    pan: {
        enabled: true,
        threshold: 10,
        modifierKey: null,
        mode: 'x',
    },
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions