<EjsDashboardLayout CellSpacing="@(new double[]{20 ,20 })" Columns="4">
<DashboardLayoutEvents Created="@onCreate"></DashboardLayoutEvents>
<DashboardLayoutPanels>
<DashboardLayoutPanel Row="0" Col="0" SizeX="2" SizeY="2">
<ContentTemplate>
<div style="height:100%;width:100%">
<EjsChart @ref="chartObj" Width="100%" Height="100%">
<ChartPrimaryXAxis ValueType="Syncfusion.EJ2.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@Sales" XName="Month" YName="SalesValue" Type="ChartSeriesType.Column">
</ChartSeries>
</ChartSeriesCollection>
</EjsChart>
</div>
</ContentTemplate>
</DashboardLayoutPanel>
</DashboardLayoutPanels>
</EjsDashboardLayout>
@code {
EjsChart chartObj;
public async Task onCreate(object args)
{
await Task.Delay(1000); // simulate the async operations
this.chartObj.Refresh();
}
}
|
<div style="height:100%;width:100%">
<EjsChart @ref="chartObj" ID="chart" Width="100%" Height="100%">
<ChartPrimaryXAxis ValueType="Syncfusion.EJ2.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
<ChartSeriesCollection>
<ChartSeries DataSource="@Sales" XName="Month" YName="SalesValue" Type="ChartSeriesType.Column">
</ChartSeries>
</ChartSeriesCollection>
</EjsChart>
</div>
<style>
#chart {
height:100%;
width:100%;
}
</style> |