添加项目文件。

This commit is contained in:
SpecialX
2025-05-23 19:03:00 +08:00
parent 6fa7679fd3
commit d36fef2bbb
185 changed files with 13413 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
@rendermode InteractiveServer
<MudPaper Class="pa-5 ma-5 rounded-lg" Width="@Width">
<MudChart ChartType=@ChartType @bind-SelectedIndex="Index" InputData="@data" InputLabels="@labels" Width=@Width Height=@Height> </MudChart>
</MudPaper>
@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;
}
}