-
Notifications
You must be signed in to change notification settings - Fork 153
Closed
Labels
chartsChart componentChart componentdashboard-layoutDashboard Layout componentDashboard Layout component
Description
I want to create a simplistic dashboard where you can add or remove charts. This gives a nice prototype for dragging and dropping but there doesn't appear to be any option for a toolbar or manu item specific for these charts?
Could somebody confirm this or maybe I'm missing something :-)
Thanks
Scott
Metadata
Metadata
Assignees
Labels
chartsChart componentChart componentdashboard-layoutDashboard Layout componentDashboard Layout component
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
G-Durga commentedon Feb 13, 2025
Scott,
Greetings from Syncfusion.
You can achieve your requirement by dynamically adding and removing panels in the Syncfusion Blazor Dashboard Layout using the AddPanelAsync and RemovePanelAsync methods. These methods allow you to add new panels and remove existing ones by specifying the panel ID.
Please check the sample below, where we have implemented adding and removing panels through button clicks.
<SfButton CssClass="e-primary" Content="Add Panel" @onclick="AddClick"></SfButton> <SfButton CssClass="e-primary" Content="Remove Panel" @onclick="RemoveClick"></SfButton> public async Task RemoveClick() { if (this.Count > 0) { string panelId = this.Count.ToString() + "_layout"; await dashboardObject.RemovePanelAsync(panelId); this.Count--; } } public async Task AddClick() { this.Count = this.Count + 1; string HeaderText = "Panel " + this.Count.ToString(); PanelModel panel = new PanelModel { Id = this.Count.ToString() + "_layout", SizeX = 2, SizeY = 2, Row = 0, Column = 0, Enabled = true, Header = @<div>@HeaderText</div>, Content =@<SfChart> <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"> </ChartPrimaryXAxis> <ChartSeriesCollection> <ChartSeries DataSource="@Sales" XName="Month" YName="SalesValue" Type="Syncfusion.Blazor.Charts.ChartSeriesType.Column"> </ChartSeries> </ChartSeriesCollection> </SfChart> }; await dashboardObject.AddPanelAsync(panel); }
Sample : https://blazorplayground.syncfusion.com/hZBoXLCABAbuIINa
UG : https://blazor.syncfusion.com/documentation/dashboard-layout/getting-started#panels-with-components
kmuthukumarmkm commentedon Jul 3, 2025
The reported query appears to be addressed in the latest update. Could you please confirm if everything works as expected? Closing for now, but feel free to reopen if needed.