mariusmuntean / ChartJs.Blazor

Brings Chart.js charts to Blazor
https://www.iheartblazor.com/
MIT License
677 stars 151 forks source link

Piechart support int #116

Closed imtrobin closed 3 years ago

imtrobin commented 4 years ago

Hi, I see Piechart is hardcoded to using double. Can it support int?

Joelius300 commented 4 years ago

This issue seems very similar to #106 and #108. If the comments there don't answer your question, please elaborate on why you would want int there. Otherwise, close this issue here.

I think this is something we need to put in an FAQ soon.

Ps. please use the issue templates.

imtrobin commented 4 years ago

It's not related. I see the Barchart has a generic dataset but the piechart supports only double. It's just easier for data that has int so I can avoid conversion.

Joelius300 commented 4 years ago

I guess it would be convenient but as you've hopefully read in the linked issues, in JavaScript all numbers are basically doubles. Representing it as 32-bit integers on our part could almost be considered wrong, that's why we just used double. It might be slightly more concise to avoid the casts so we'll consider it. With #96 done, this should be easy to implement but we'll go about that later.
It should be implemented in the upcoming 2.0 release. Until then you'll have to cast.