93Alliance / ng-chartjs

A fully functional Angular2+ chart.js library.
https://93alliance.github.io/ng-chartjs/
MIT License
87 stars 10 forks source link

Pie chart having groupped labels with values #21

Closed ursedaniel closed 3 years ago

ursedaniel commented 3 years ago

Hello, I want to have the pie chart values groupped, i see that I can do that with Labels, but for the values I can't have an array of values, do you guys know a way to achieve this? As you can see in the photo only the first label has the corresponding value, but the 2nd one doesnt. Thanx!

Screenshot 2020-08-02 at 16 10 11 Screenshot 2020-08-02 at 16 12 33
93Alliance commented 3 years ago

You can't use pie chart with your dataset. You could try bar chart.

[[300,15],500,100]

Because in pie chart, chart.js need to calculate the scale, [300, 15] can't be calculated with other values in the array.

93Alliance commented 3 years ago

You can try it. https://stackblitz.com/edit/angular-ngchartjs-issues21

ursedaniel commented 3 years ago

@93Alliance worked like a charm, thank you so much!

ursedaniel commented 3 years ago

I'm facing a problem, when running with --prod flag I get this error in console after following your example @93Alliance : Screenshot 2020-10-18 at 17 49 21

Screenshot 2020-10-18 at 17 49 39 Screenshot 2020-10-18 at 17 49 58

Any ideas how to fix it? without --prod flag it works pretty good but I need it to be prod valid, thanks!