@using TechHelper.Client.Pages.Common.Exam; @using TechHelper.Client.Pages.Student.BaseInfoCard; @using TechHelper.Client.Pages.Common; @code { public double[] data = { 25, 77, 28, 5 }; public string[] labels = { "Oil", "Coal", "Gas", "Biomass" }; private AxisChartOptions _axisChartOptions = new AxisChartOptions(); private ChartOptions options = new ChartOptions(); public List Series = new List() { 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 } }, }; public string[] XAxisLabels = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep" }; Random random = new Random(); protected override void OnInitialized() { options.InterpolationOption = InterpolationOption.NaturalSpline; options.YAxisFormat = "c2"; _axisChartOptions.MatchBoundsToSize = true; } public void RandomizeData() { foreach (var series in Series) { for (int i = 0; i < series.Data.Length - 1; i++) { series.Data[i] = random.NextDouble() * 100 + 10; } } StateHasChanged(); } void OnClickMenu(InterpolationOption interpolationOption) { options.InterpolationOption = interpolationOption; StateHasChanged(); } }