-
-
Notifications
You must be signed in to change notification settings - Fork 538
Description
Heyo Blazorise
I'm the maintainer of ChartJs.Blazor which is basically a stand-alone version of Blazorise.Charts if I understand correctly.
I just released version 2.0 and now the future is uncertain because our situation isn't great.
I opened this issue just to ask openly how you would feel about a collaboration.
Having worked on ChartJs.Blazor for over a year now, I have learned some things about issues you've surely encountered as well. The most obnoxious being that you cannot customize the serializer used in IJSRuntime
and thus you can't avoid null values without some crazy workaround.
Here are some of the most notable difference that I found:
Disclaimer: I have not used Blazorise.Charts myself, I only looked at the code and the docs.
- ChartJs.Blazor uses JSON.NET behind the scenes in order to avoid the limitations System.Text.Json currently has.
- ChartJs.Blazor uses inheritance in their option models so it's serialize-only (with some exceptions like the event-parameters).
- More Callbacks are supported with typed arguments.
- Things like
Easing
,FontStyle
, etc. are all typed with custom enums (calledStringEnum
) which basically implement the "type-safe enum pattern" and thus aren't as nice to use as standard C# enums but are extendable and make much less trouble for serialization. - Other options which only accept certain values like
FillingMode
but may have different types use theObjectEnum
which is the more open alternative toStringEnum
and has similarities to discriminated unions. These make the use of those options much nicer. - ChartJs.Blazor supports Indexable options via
IndexableOptions
- Blazorise.Charts handles colors better than ChartJs.Blazor but things like gradients aren't supported in either.
- In ChartJs.Blazor you can do changes to the dataset completely separate from the chart and then just call update to apply the changes. Currently, these do not track where and what changed so Chart.js has to figure that out by themselves in order to play the most appropriate animation but for what I've used it, Chart.js is pretty good at that. In Blazorise.Charts you have to call appropriate custom methods to update the datasets.
- ChartJs.Blazor uses nullable options everywhere which means it will use the Chart.js default (which can be changed) instead of the hardcoded C# default
- Blazorise.Charts supports streaming (through Blazorise.Charts.Streaming and chartjs-plugin-streaming).
- Blazorise.Charts can only contain one type of item in a chart which prevents many mixed chart scenarios.
I'm sure there's more but I think both ChartJs.Blazor and Blazorise.Charts try to achieve more or less the same.
I have no specific idea in mind and this is just a really open question but I think it's worth bringing it up here. It was brought to my attention in this comment.
So what do you think? 😄
Ps and note to self: If we're doing something big here, maybe do something for non-blazor users as well.