@rendermode InteractiveServer @code { private int Index = -1; private ChartOptions options = new ChartOptions(); public double[] data = { 50, 25, 20, 5 }; public string[] labels = { "Fossil", "Nuclear", "Solar", "Wind" }; [Parameter] [Category("Behavior")] public ChartType ChartType { get; set; } = ChartType.Donut; [Parameter] [Category("Appearance")] public string Width { get; set; } = "80%"; [Parameter] [Category("Appearance")] public ChartOptions ChartOptions { get; set; } = new ChartOptions(); [Parameter] [Category("Appearance")] public string Height { get; set; } = "80%"; [Parameter] public string XAxis { get; set; } public string[] XAxisLabels = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep" }; protected override async Task OnInitializedAsync() { options.InterpolationOption = InterpolationOption.NaturalSpline; options.YAxisFormat = "c2"; ChartOptions = options; } }