ng2-charts
ng2-charts copied to clipboard
ChartOptions plugins
I'm trying to use this plugin with 'ng2-charts' https://nagix.github.io/chartjs-plugin-colorschemes/ but I can't find any example on this, what's the right way to do this ?
options: ChartOptions = {
plugins: {
pluginId: 'chartjs-plugin-colorschemes'
}
};
Also tried this but it didn't work
Chart.defaults.global.plugins.colorschemes.scheme = 'brewer.RdPu4';
Thanks
Same here.. I got same problems.. Anyone have Idea about this ?
plugins: {
colorschemes: {
scheme: 'brewer.YlGn4'
}
},
There is an example here: https://valor-software.com/ng2-charts/#/LineChart
ts:
import * as chartDownsamplePlugin from 'chartjs-plugin-downsample';
export class MyComponent {
chartPlugins = [chartDownsamplePlugin];
}
template:
<canvas baseChart
[data]="chartData"
[options]="chartOptions"
[plugins]="chartPlugins"
chartType="line"
>
</canvas>
I had similar issue too just now. You have to override the colors by setting override: true
in the plugin settings:
plugins: {
colorschemes: {
scheme: 'brewer.YlGn4',
+ override: true
}
},
Shown in LineChart how to use a plugin that requires registration.