MudBlazor / MudBlazor

Blazor Component Library based on Material design with an emphasis on ease of use. Mainly written in C# with Javascript kept to a bare minimum it empowers .NET developers to easily debug it if needed.
http://mudblazor.com
MIT License
8.01k stars 1.28k forks source link

Data range x axis on line chart #1015

Closed ClumsyPenguin closed 3 years ago

ClumsyPenguin commented 3 years ago

Can i choose a data range for my x-axis on the line graph?

Currently it goes directly to 20, but i want also to see the numbers: 5,10 and 15.

image

ThumbGen commented 3 years ago

This is an amazing and well-design library. But, don't do charts, they are way too complex to do right. Try adopting Plotly or Charts.JS and focus on the other things which make this lib unique.

ClumsyPenguin commented 3 years ago

It is indeed a well-designed library, but i think it would be advantage to implement complexer charting than it has at the moment.

If i introduce my app to an another external dependency it would be a disadvantage long term to maintain...

But i disagree to not implement it with this library. The blazor libraries that provide complex charting are merely wrappers around existing js libraries.

mikes-gh commented 3 years ago

@ClumsyPenguin I agree. But I think doing a comprehensive pure Blazor/SVG charting is not easy without JS and probably very time consuming. So if you need complex charting you might have to take an external dependency for a while yet. Having said that the current implementation is lacking. If anyone wants to do a list of what they think are important but achievable features they are welcome but there's no guarantee it will be implemented.

ClumsyPenguin commented 3 years ago

I contacted @Garderoben to see if we can implement a basic bar chart.

Further suggestions are:

They don't have to be complex or feature-rich right of the bat, but having those options open will help the charting functionality of this library.

Garderoben commented 3 years ago

@mikes-gh @ClumsyPenguin its already possible, i havent documented it well enough yet.

image https://try.mudblazor.com/snippet/QkQlkxEbTGkshrOh

ClumsyPenguin commented 3 years ago

This issue can be closed. It has been resolved with

<MudChart ChartType="ChartType.Line" ChartOptions="Options" ChartSeries="@Series" XAxisLabels="@XAxisLabels"></MudChart>

Options.YAxisTicks = 10;