Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145662 | Jul 2,2019 07:57 PM UTC | Jul 3,2019 12:35 PM UTC | Blazor | 1 |
![]() |
Tags: Charts |
<div class="control-section">
<button onclick="@dataChange">Change the Data</button>
<EjsChart id="container" width="60%">
<ChartPrimaryXAxis ValueType="Syncfusion.EJ2.Blazor.Charts.ValueType.Double">
</ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries dataSource="@dataSource" xName="xValue" yName="yValue" name="India" type="ChartSeriesType.Bar">
</ChartSeries>
</ChartSeriesCollection>
</EjsChart>
</div>
@functions{
public class ChartData
{
public double xValue;
public double yValue;
public double yValue1;
}
List<ChartData> dataSource = new List<ChartData> {
new ChartData { xValue = 10, yValue = 21 },
new ChartData { xValue = 20, yValue = 24 },
new ChartData { xValue = 30, yValue = 36 },
new ChartData { xValue = 40, yValue = 38 },
new ChartData { xValue = 50, yValue = 54 },
new ChartData { xValue = 60, yValue = 57 },
new ChartData { xValue = 70, yValue = 70 },
};
void dataChange()
{
this.dataSource = new List<ChartData> {
new ChartData { xValue = 20, yValue = 55 },
new ChartData { xValue = 40, yValue = 15 },
new ChartData { xValue = 60, yValue = 75 },
};
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.