Closed SeppPenner closed 5 years ago
I try to check how easy this is and to find the issue with the static assets soon @Joelius300.
We could only do this with the canvas
-element. The actual Chart
is a js-object which is never exposed to the c# part. Do you know any benefits this would have over the current approach?
The static assets issue is more important at the moment I think :)
We could only do this with the canvas-element. The actual Chart is a js-object which is never exposed to the c# part. Do you know any benefits this would have over the current approach?
Well, it's more clean, I guess. (Moving most of the code towards C#).
The static assets issue is more important at the moment I think :)
Yes, I will check this soon.
Moving most of the code towards C#
Fair enough.
Kind of related:
Maybe we should also think about using a new GUID string as default id. This will reduce the collisions if no id was specified which is probably what most users would do if they could.
Maybe we should also think about using a new GUID string as default id. This will reduce the collisions if no id was specified which is probably what most users would do if they could.
I wouldn't even allow to let them chose an id... :D Makes it more restricted, but more save.
Good idea!
But we should still keep the getter in case they want to use that canvas for their own js-interop (extensions) and need to access its id.
I've created an issue for it so we don't pollute this one with other changes: https://github.com/Joelius300/ChartJSBlazor/issues/77
But we should still keep the getter in case they want to use that canvas for their own js-interop (extensions) and need to access its id.
That's true. I guess, this is not a big deal and can be done easily.
Is tracked by https://github.com/mariusmuntean/ChartJs.Blazor/issues/42 after the merge.
Describe the feature request
It would be a good idea to use the
ElementReference
type to reference the charts from C# to JS. Example (Although it's a bit outdated): https://visualstudiomagazine.com/blogs/tool-tracker/2018/11/an-ad-hoc-approach.aspxWhich charts does this feature request apply to?
All.
Describe the solution you'd like
Like in the example:
Razor:
Javascript:
Describe alternatives you've considered
None.
Additional context
Example: https://visualstudiomagazine.com/blogs/tool-tracker/2018/11/an-ad-hoc-approach.aspx.