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
Agent and App Development Solutions
Build. Accelerate. Govern.
AI-Ready Application Experiences
AI-Assisted SDLC
Agent Governance and Control
Telerik
Build modern .NET business apps
.Net Web
Desktop
Reporting and Documents
Cross-Platform
Additional Tools
Enhance the developer and designer experience
Testing & Mocking
CMS
Debugging
UI Tools
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.