Product Bundles
DevCraft
All Telerik .NET and Kendo UI JavaScript components and AI Tools in one package.
Kendo UI
Bundle of AI Tools plus four JavaScript UI libraries built natively for jQuery, Angular, React and Vue.
Build JavaScript UI
Javascript
Telerik
Build modern .NET business apps
.Net Web
Cross-Platform
Desktop
Reporting and Documents
AI for Developers & IT
Ensure AI program success
MCP Servers
AI for UI
AI Engineering
Additional Tools
Enhance the developer and designer experience
Testing & Mocking
Debugging
UI Tools
CMS
Free Tools
Hi Anu,
I am not sure I understood the exact scenario you want to achieve. The legend does not have a click event.
If you want to add/remove series to the chart, for example, you can add a button above the chart and on button click to add/remove series.
The Chart Series is a collection, so you can add series to the char.
Example:
<Grid RowDefinitions="Auto,*"> <Button Text="add series " Clicked="Button_Clicked" /> <telerikChart:RadCartesianChart x:Name="chart" Grid.Row="1"> <telerikChart:RadCartesianChart.BindingContext> <local:CategoricalDataViewModel /> </telerikChart:RadCartesianChart.BindingContext> <telerikChart:RadCartesianChart.HorizontalAxis> <telerikChart:CategoricalAxis LabelFitMode="MultiLine" /> </telerikChart:RadCartesianChart.HorizontalAxis> <telerikChart:RadCartesianChart.VerticalAxis> <telerikChart:NumericalAxis LabelFitMode="MultiLine" /> </telerikChart:RadCartesianChart.VerticalAxis> <telerikChart:RadCartesianChart.Series> <telerikChart:BarSeries ValueBinding="Value" CategoryBinding="Category" ItemsSource="{Binding Data}" /> </telerikChart:RadCartesianChart.Series> </telerikChart:RadCartesianChart> </Grid>
and on button click:
private void Button_Clicked(object sender, System.EventArgs e) { this.chart.Series.Add(new BarSeries { ValueBinding = new PropertyNameDataPointBinding("Value"), CategoryBinding = new PropertyNameDataPointBinding("Category") }); this.chart.Series[1].SetBinding(ChartSeries.ItemsSourceProperty, "Data1"); }
Hi Anu,
I am not sure I understood the exact scenario you want to achieve. The legend does not have a click event.
If you want to add/remove series to the chart, for example, you can add a button above the chart and on button click to add/remove series.