I have couple of questions.
My Requirement
- Add Series Dynamically by dragging item from Grid View (DONE)
- On Legend Item Show Context Menu.
- 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 =
false;
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;
chartTimeSeries.DefaultView.ChartLegend.Items.Add(item1);
Then by retemplatting Legend item show context menu on it.
Now i have a UniqueIdentifier of the tag which is currently selected.
private
void mnuLineChart_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
string
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.
Thanks
Pratik Mehta