I am exploring Mudblazor. I created a doughnut chart and it works fine. But I need to define the colors of the slices of the pie/doughnut. I see you can have a class for the entire chart, but how do set custom colors for each slice of the pie?
The default for a 3 slice pie is like blue, teal and gold. I need to change those colors and will need to be changed in code also.
The theming palette options don't seem to have options for this.
Thanks,
Michael
Edit: I figured it out. In case anyone else needs to do this. Example:
ChartOptions options = new ChartOptions();
protected override void OnInitialized()
{
string[] colors = { "#ff0000", "#00FF00","#0000ff" };
options.ChartPalette = colors;
}
Chart-add ChartOptions="@options":
ChartOptions options = new() { ChartPalette = new[] { "#ff0000", "#00FF00", "#0000ff" } };
– Moose