|
1 | 1 | @page "/" |
2 | 2 |
|
3 | | -<EjsChart Title="Monthly Sales Analysis"> |
4 | | - <ChartPrimaryXAxis Title="Month" |
5 | | - ValueType="Syncfusion.EJ2.Blazor.Charts.ValueType.Category"> |
6 | | - </ChartPrimaryXAxis> |
7 | | - <ChartPrimaryYAxis Title="Sales(Dollars)"> |
8 | | - </ChartPrimaryYAxis> |
9 | | - <ChartTooltipSettings Enable="true"> |
10 | | - </ChartTooltipSettings> |
11 | | - <ChartLegendSettings Visible="true"> |
12 | | - </ChartLegendSettings> |
13 | | - <ChartSeriesCollection> |
14 | | - <ChartSeries DataSource="@Sales" Type="ChartSeriesType.Column" |
15 | | - XName="Month" YName="SalesValue" Name="Sales"> |
16 | | - <ChartMarker> |
17 | | - <ChartDataLabel Visible="true" > |
18 | | - </ChartDataLabel> |
19 | | - </ChartMarker> |
20 | | - </ChartSeries> |
21 | | - </ChartSeriesCollection> |
22 | | -</EjsChart> |
| 3 | + |
| 4 | + <SfChart Title="Monthly Sales Analysis"> |
| 5 | + <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category" |
| 6 | + Title="Months"> |
| 7 | + </ChartPrimaryXAxis> |
| 8 | + <ChartPrimaryYAxis Title="Sales (Dollars)"> |
| 9 | + </ChartPrimaryYAxis> |
| 10 | + <ChartLegendSettings Visible="true"> </ChartLegendSettings> |
| 11 | + <ChartTooltipSettings Enable="true"></ChartTooltipSettings> |
| 12 | + <ChartSeriesCollection> |
| 13 | + <ChartSeries Type="ChartSeriesType.Column" DataSource="@Sales" |
| 14 | + XName="Month" YName="SalesValue" Name="Sales"> |
| 15 | + <ChartMarker> |
| 16 | + <ChartDataLabel Visible="true"> </ChartDataLabel> |
| 17 | + </ChartMarker> |
| 18 | + </ChartSeries> |
| 19 | + </ChartSeriesCollection> |
| 20 | + </SfChart> |
23 | 21 |
|
24 | 22 | @code { |
25 | | - public class SalesData { |
26 | | - public string Month; |
27 | | - public double SalesValue; |
| 23 | + public class SalesData |
| 24 | + { |
| 25 | + public string Month { get; set; } |
| 26 | + public double SalesValue { get; set; } |
28 | 27 | } |
29 | | - public List<SalesData> Sales = new List<SalesData> |
| 28 | + |
| 29 | + public List<SalesData> Sales = new List<SalesData> |
30 | 30 | { |
31 | 31 | new SalesData { Month = "January", SalesValue = 35 }, |
32 | 32 | new SalesData { Month = "February", SalesValue = 28 }, |
|
0 commit comments