|
// add your additional code here
@using Syncfusion.Blazor.Charts
<SfStockChart>
<StockChartEvents PeriodChanged="StockChartPeriodChanged"></StockChartEvents> <StockChartSeriesCollection> <StockChartSeries DataSource="@StockDetails" Type="ChartSeriesType.Column" XName="Date" YName="Y"> </StockChartSeries> </StockChartSeriesCollection> </SfStockChart> @code {
public class ChartData { public DateTime Date { get; set; } public Double Y { get; set; } } public List<ChartData> StockDetails = new List<ChartData>
{ new ChartData { Date = new DateTime(2012, 04, 02), Y= 100}, new ChartData { Date = new DateTime(2012, 04, 09), Y= 10 }, new ChartData { Date = new DateTime(2012, 04, 16), Y= 500}, new ChartData { Date = new DateTime(2012, 04, 23), Y= 80 }, new ChartData { Date = new DateTime(2012, 04, 30), Y= 200}, new ChartData { Date = new DateTime(2012, 05, 07), Y= 600}, new ChartData { Date = new DateTime(2012, 05, 14), Y= 50 }, new ChartData { Date = new DateTime(2012, 05, 21), Y= 700}, new ChartData { Date = new DateTime(2012, 05, 28), Y= 90 } }; public void StockChartPeriodChanged(StockChartPeriodChangedEventArgs args) { // Here you can customize your code } } // add your additional code here
|