Plugins 如何仅在chartjs插件缩放中允许在范围之间进行缩放

Plugins 如何仅在chartjs插件缩放中允许在范围之间进行缩放,plugins,zooming,chart.js,Plugins,Zooming,Chart.js,插件缩放() 我只想在提供的范围之间显示缩放,就像轴上的{minzoom:0,max show:100}。有没有相同的想法?您只能添加缩放范围,此范围将是您的画布宽度 zoom: { // Boolean to enable zooming enabled: true, // Enable drag-to-zoom behavior drag: true, // Zooming directions. Remov

插件缩放()


我只想在提供的范围之间显示缩放,就像轴上的{minzoom:0,max show:100}。有没有相同的想法?

您只能添加缩放范围,此范围将是您的画布宽度

zoom: {
        // Boolean to enable zooming
        enabled: true,

        // Enable drag-to-zoom behavior
        drag: true,

        // Zooming directions. Remove the appropriate direction to disable 
        // Eg. 'y' would only allow zooming in the y direction
        mode: 'xy',
        rangeMin: {
            // Format of min zoom range depends on scale type
            x: null,
            y: null
        },
        rangeMax: {
            // Format of max zoom range depends on scale type
            x: null,
            y: null
        }
    }