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

Piechart support int #116

Closed
imtrobin opened this issue May 30, 2020 · 3 comments
Closed

Piechart support int #116

imtrobin opened this issue May 30, 2020 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@imtrobin
Copy link

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

@imtrobin imtrobin added the enhancement New feature or request label May 30, 2020
@Joelius300
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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.

@Joelius300 Joelius300 added this to the 2.0.0 milestone Jun 1, 2020
Joelius300 added a commit to Joelius300/ChartJs.Blazor that referenced this issue Sep 6, 2020
The default, non-generic type is tied to double which is most natural for JavaScript interop but you can now use other types like int if you don't want to use double (e.g. to avoid casting or for semantic reasons).

Closes mariusmuntean#116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants