mariusmuntean / ChartJs.Blazor

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

Improved samples #122

Open Joelius300 opened 4 years ago

Joelius300 commented 4 years ago

With #153, I have laid out the foundation for this issue. Instead of the three (redundant) sample projects, we now have a dual-mode blazor application that looks and feels similar to the official Chart.js samples.

Now we need your help!

If you want to contribute to this library and/or get to know ChartJs.Blazor, you can port one of the samples listed below and submit a Pull Request. Please write a short comment on this issue before getting to work on the PR in order to avoid conflicts with other contributors.

If you decide to port a sample, please keep the following points in mind:

If you hit any roadblocks along the way (e.g. you simply cannot port a sample because we don't support that feature yet), this issue is the place to discuss it. I highly recommend to start with the easier samples that don't contain any of the known hurdles like callbacks.

Below you can find a list of samples we want to port. I will tick them off once they're merged.

We appreciate your contributions!

Important

Bar charts
Line charts
Area charts
Other charts
Linear scale
Logarithmic scale
Time scale
Scale options
Legend
Tooltip

Additional

Bar charts
Line charts
Other charts
Scale options
Tooltip
Scriptable
Advanced
Before edit

Currently our library has three sample projects. That's too much. Our samples also don't show nearly all features Chart.js resp. our library has. Nor are they analogous to the [official Chart.js samples](https://www.chartjs.org/samples/latest/) which understandably [generates confusion](https://github.com/mariusmuntean/ChartJs.Blazor/issues/111). ## Solution ### Client- / Server-side Currently we have lots of redundancies because of our three projects. We should eliminate two of them and run them in dual mode. There's already an [amazing resource for running blazor in dual mode](https://github.com/Suchiman/BlazorDualMode) which we can take as reference. Once this is done, we can also update https://www.iheartblazor.com with these samples so you can swich between client and server without having to build the samples yourself. ### Porting samples We should try to mirror the offical samples in order to show our consumers how to achieve the same thing. This has the many benefits like more clarity for the simple user when trying to achieve something and a reference for the people who already know Chart.js. It's also simpler for us to maintain and to give support. Of course some additional samples might be needed e.g. for the callback stuff, especially when you consider the [server-side incompatibility](https://github.com/mariusmuntean/ChartJs.Blazor/issues/90).

Format checklists

```javascript var x = ... from https://github.com/chartjs/Chart.js/blob/2.9/samples/samples.js var l = ''; x.forEach(y => { l+='\n### ' + y.title + '\n'; y.items.forEach(z => l+='[' + z.title + '](https://www.chartjs.org/samples/latest/' + z.path + ')\n')}); ```

mariusmuntean commented 4 years ago

I agree with improving the samples; that should make it much easier to understand how to achieve a certain result with ChartJs.Blazor.

Joelius300 commented 4 years ago

@mariusmuntean What do you think of my priority grouping (important / additional)?