添加项目文件。
This commit is contained in:
41
TechHelper.Client/Pages/Components/GrageView.razor
Normal file
41
TechHelper.Client/Pages/Components/GrageView.razor
Normal file
@@ -0,0 +1,41 @@
|
||||
<MudPaper Class="pa-5 ma-5 rounded-lg" Width="@Width" >
|
||||
<MudChart ChartType=@ChartType ChartSeries="@Series" XAxisLabels="@XAxisLabels" Width=@Width Height=@Height ChartOptions=@ChartOptions></MudChart>
|
||||
</MudPaper>
|
||||
@code {
|
||||
private ChartOptions options = new ChartOptions();
|
||||
public List<ChartSeries> Series = new List<ChartSeries>()
|
||||
{
|
||||
new ChartSeries() { Name = "Series 1", Data = new double[] { 90, 79, 72, 69, 62, 62, 55, 65, 70 } },
|
||||
new ChartSeries() { Name = "Series 2", Data = new double[] { 35, 41, 35, 51, 49, 62, 69, 91, 148 } },
|
||||
};
|
||||
|
||||
[Parameter]
|
||||
[Category("Behavior")]
|
||||
public ChartType ChartType { get; set; } = ChartType.Line;
|
||||
|
||||
[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