Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Hello,
I want to display dynamic charts using the RenderTreeBuilder inside my pannels but i got the following error:
System.Collections.Generic.KeyNotFoundException: The given key 'PrimaryXAxis' was not present in the dictionary.
at Syncfusion.Blazor.Charts.Internal.ChartAxisRendererContainer.AssignAxisToSeries(IEnumerable`1 seriesList, Boolean refreshSeries)
at Syncfusion.Blazor.Charts.SfChart.InitiAxis()
at Syncfusion.Blazor.Charts.SfChart.PerformLayout()
at Syncfusion.Blazor.Charts.SfChart.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
<SfDashboardLayout @ref="dashboard" CellSpacing="@(new double[] { 10, 10 })" Columns="5">
<DashboardLayoutPanels>
@foreach (var panel in panels)
{
<DashboardLayoutPanel Id="@panel.Id" SizeX="@panel.SizeX" SizeY="@panel.SizeY" Row="@panel.Row" Column="@panel.Column"><ContentTemplate>
@(panel.Content)
</ContentTemplate></DashboardLayoutPanel>}
</DashboardLayoutPanels></SfDashboardLayout>@code{
public SfDashboardLayout dashboard;ListChartDataList { get; set; } protected override void OnInitialized(){ChartDataList = new List{new ChartData { Date = new DateTime(2023, 1, 1), AverageIndex = 10 },new ChartData { Date = new DateTime(2023, 2, 1), AverageIndex = 20 },new ChartData { Date = new DateTime(2023, 3, 1), AverageIndex = 30 },};}private RenderFragment CreateChartComponent(IEnumerable}
But i have no error when I display my charts like this :
@foreach (var panel in panels) {<div>@(panel.Content)</div>}