[Chartjs]-Pan on chart.js also zoom on line charts

1๐Ÿ‘

โœ…

I solved this problem by editing function panIndexScale of file Chart.Zoom.js. I changed
var offsetAmt = Math.max((scale.ticks.length - ((scale.options.gridLines.offsetGridLines) ? 0 : 1)), 1); to

var offsetAmt = Math.max((scale.ticks.length - 0), 1); 

now pan and zoom work correctly.

Leave a comment