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

LineSeries Chart Styles

1 Answer 49 Views
Chart
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 =

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

1 Answer, 1 is accepted

Sort by
0
Dwight
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).

Regards,
Joshua
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
Tags
Chart
Asked by
pratik mehta
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Share this question
or