chartjs-plugin-draggable icon indicating copy to clipboard operation
chartjs-plugin-draggable copied to clipboard

Dragging annotations invalidates custom ticks callback

Open scharnyw opened this issue 6 years ago • 0 comments

Hi,

The chart refresh that occurs when dragging line annotations does not honor the custom ticks callback that user provides in chart options, i.e.

options = {
    scales: {
      xAxes: [{
        display: true,
        type: "linear",
        ticks: {
          callback: (tick, index, ticks) => {
              // custom ticks formatter
          }
    }
}

Instead the default callback is always used. One solution is to override the default callback but this is hardly the optimal solution especially when I'd want different types of ticks on multiple plots:

Chart.scaleService.updateScaleDefaults('logarithmic', {
    ticks: {
        callback: function(tick, index, ticks) {
            // new default callback
        }
    }
});

Any idea why the custom cb is skipped in this case?

scharnyw avatar Nov 05 '18 03:11 scharnyw