This is a migrated thread and some comments may be shown as answers.

LineSeries Chart Styles

1 Answer 65 Views
This is a migrated thread and some comments may be shown as answers.
pratik mehta
Top achievements
Rank 1
pratik mehta asked on 23 Jun 2010, 12:49 PM
Hi ,

I have couple of questions.

My Requirement

  1. Add Series Dynamically by dragging item from Grid View (DONE)
  2. On Legend Item Show Context Menu.
  3. On Click of Context Meny Item Set the Line as Dotted and change the color of Line.

For the second one i have disabled  Auto Generated chart Items by adding following line.


chartTimeSeries.DefaultView.ChartLegend.UseAutoGeneratedItems =




then i created Legend item for each series manually and assign UniqueIdentifier to Tag of legend item.



ChartLegendItem item1 = new ChartLegendItem();


item1.Label = oAssetTimeSeriesData.AssetName;

item1.Tag = oAssetTimeSeriesData.UniqueIdentifier;


Then by retemplatting Legend item show context menu on it.

Now i have a UniqueIdentifier of the tag which is currently selected.




void mnuLineChart_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)






uId= ((RadContextMenu)sender).GetClickedElement<ChartLegendItem>().Tag.ToString();



and i want to find lineseries associated with this ChartLegend item and change its style to dotted line.

also want to reload chart again.


Pratik Mehta

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 28 Jun 2010, 08:35 AM
Hi Pratik,

When manually adding elements to the legend, those items are not associated with any series at all. You will need to associate it when adding it to the legend (by say setting the series as DataContext).

the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
pratik mehta
Top achievements
Rank 1
Answers by
Telerik team
Share this question