I am currently working on developing a standalone Angular library for chart.js that will include plugins.
It appears that when plugins are registered in chart.js, the ChartConfiguration
type is altered to allow for plugin configuration.
If chart.js did not make these modifications, linting errors would occur as demonstrated in this question..
For instance, if the gradient plugin is registered as follows:
import gradient from 'chartjs-plugin-gradient';
Chart.register(...registerables);
Chart.register(gradient);
Is it possible to export the modified chart configuration type (ChartConfiguration
) from an Angular library so that clients can configure chart.js with support for pre-packaged plugins?
This would allow clients to import the modified configuration like this:
import { ChartConfiguration } from 'angular-chartjs-library';
Then create instances of chart.js configurations/options supported by the namespace in ChartConfiguration
.