Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register with Chart.register? #39

Open
awdorrin opened this issue Apr 15, 2024 · 0 comments
Open

Register with Chart.register? #39

awdorrin opened this issue Apr 15, 2024 · 0 comments

Comments

@awdorrin
Copy link

Using the following:

"chart.js": "^4.4.2",
"chartjs-plugin-annotation": "^3.0.1",
"chartjs-plugin-colorschemes": "^0.4.0",
"chartjs-plugin-datalabels": "^2.2.0",
"ng2-charts": "^5.0.4",

I am trying to create a custom color scheme, as shown in the docs:

colors: string[] = ['#43B02A', '#61B3E4', '#9E7691', '#70A087', '#00968F', '#CC6C4E', '#005E5D', '#007396', '#59315F', '#414042', '#003CA6', '#7DDBD3', '#FFCD00'];
 public lineChartOptions: ChartConfiguration['options'] = {
   responsive: true,
   plugins: {
     legend: { position: 'top', },
     title: { display: true, text: 'Chart.js Line Chart' },
     colorscheme: { scheme: this.colors, }
   }
 };
 public lineChartType: ChartType = 'line';

however, I get an error on the colorscheme line stating:
Object literal my only specify known properties, and 'colorscheme' does not exist in type '_DeepPartialObject<PluginOptionsByType<keyof ChartTypeRegistry>>'

I figure this is a ng2-charts issue, related to Chart.register() - but I have not been able to figure out how to register this plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant