chartjs / chartjs-plugin-datalabels

Chart.js plugin to display labels on data elements
https://chartjs-plugin-datalabels.netlify.app
MIT License
863 stars 459 forks source link

Make datalabels property optional in PluginOptionsByType interface #381

Closed cluzier closed 1 year ago

cluzier commented 1 year ago

This pull request addresses an error in the code by making the datalabels property optional in the PluginOptionsByType interface. The change allows for more flexibility in configuring the datalabels plugin for different chart types.

Changes Made:

Testing Done:

stockiNail commented 1 year ago

See PR #376

cluzier commented 1 year ago

See PR #376

Is there a fix for those of us who are using TS? I read through the comments but doesn't seem like there was any sort of solution.

stockiNail commented 1 year ago

See PR #376

Is there a fix for those of us who are using TS? I read through the comments but doesn't seem like there was any sort of solution.

The both PRs are going to apply the same change which is a workaround to solve the issue #374. Therefore the answer is yes but there are some doubts if this change makes really sense (setting default type) or if not better to fix it (if possible) in main repo of Chart.js.

stockiNail commented 1 year ago

@cluzier the issue is not related to the plugin but is in CHART.JS. See comment https://github.com/chartjs/Chart.js/issues/11288#issuecomment-1561777505 and PR which is fixing this issue: https://github.com/chartjs/Chart.js/pull/11309

The bug fixing will be released in next CHART.JS version and nothig to do in datalabels. I think you could close this PR.

cluzier commented 1 year ago

@cluzier the issue is not related to the plugin but is in CHART.JS. See comment chartjs/Chart.js#11288 (comment) and PR which is fixing this issue: chartjs/Chart.js#11309

The bug fixing will be released in next CHART.JS version and nothig to do in datalabels. I think you could close this PR.

Thank you for clearing this up for me!