i have the chartjs-plugin-zoom.js file in my solution and just added two more function to the chart instance to zoom in and zoom out after the _WheelHandler function.
chartInstance.ZoomIn = function () {
var rect = document.getElementById(chartInstance.canvas.id).getBoundingClientRect();
var center = {
x: rect.width / 2,
y: rect.height / 2
};
doZoom(chartInstance,1.1,center);
};
chartInstance.ZoomOut = function () {
var rect = document.getElementById(chartInstance.canvas.id).getBoundingClientRect();
var center = {
x: rect.width / 2,
y: rect.height / 2
};
doZoom(chartInstance,0.909,center);
};
Woul love to see working example, cant make it work.
Originally posted by @ravau in #43 (comment)
hi .. could you explain better how to use this your solution?
thank you!