[Chartjs]-How to rotate datalabels in Charts.js with plugins?

2๐Ÿ‘

โœ…

As per Issue at github repository for CHARTJS https://github.com/chartjs/Chart.js/issues/5667

You may need to adjust your data in following way:

dataOpen1.push({
          x: date_corrected,
          y: value.wind_speed
          d: value.wind_deg
});

And then you can modify using datalable plugin your function as

rotation: function(ctx) { return ctx.dataset.data[ctx.dataIndex].d; }

Leave a comment