添加项目文件。
This commit is contained in:
45
TechHelper.Client/Pages/Components/ErrorDis.razor
Normal file
45
TechHelper.Client/Pages/Components/ErrorDis.razor
Normal 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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user