Makanz / chartjs-plugin-trendline

This plugin draws an linear trendline in your Chart. Made for Chart.js > 3.0
MIT License
80 stars 57 forks source link

Fix some ES6 syntax issue and add support for getting axis keys from options #85

Closed elesueur closed 5 months ago

elesueur commented 8 months ago

xAxis and yAxis keys are currently hard-coded as either 'x', or 't' and 'y'.

This change adds support to use the provided xAxisKey and yAxisKey values from the chartjs options object that is provided by the user.

Fall back to the original behavior in case these are not provided.

This is a non-breaking change.

Also, add the 'const' keyword in front of the addFilter method.