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

Chart Legend items style

6 Answers 136 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Chris Thierry
Top achievements
Rank 1
Chris Thierry asked on 07 Jul 2011, 07:13 PM
Hi,
I'm using a RadChart in my page, when user selects an item (item is exploded) it shows in the legend the selected item (icon next to the item name), I want to change also the chart legend item name, change the style of the selected chart legend item. Is it possible to do it? because only the icon is not very obvious, I want also the item, for example change the forecolor, so use can see easily what was selected.

I'm trying to do this but in code-behind: http://www.telerik.com/support/kb/silverlight/chart/customize-the-chartlegend-appearance.aspx

Style style = new Style { TargetType = typeof(ChartLegendItem) };
  
Setter fg = new Setter(Control.ForegroundProperty, new SolidColorBrush(Colors.Red));
  
style.Setters.Add(fg);
                      
this.myChart.DefaultView.ChartLegend.LegendItemStyle = style;

This is working only before chart is loaded before setting the ItemsSource, if I need to do it after, without reloading the chart, is not working and beside I just need it for selected item only.

Thank you.

6 Answers, 1 is accepted

Sort by
0
Chris Thierry
Top achievements
Rank 1
answered on 12 Jul 2011, 02:56 PM
Please, I need a solution for this.
Thank you.
0
Sia
Telerik team
answered on 12 Jul 2011, 06:23 PM
Hello Chris Thierry,

One possible solution is to modify the style of all chart legend items. Please review the attached project, where I have added a Storyboard where I change the Text Block's foreground in the ChartLegendItem. You can set this custom style in your code behind.

Please let me know if this is appropriate for your case. Thank you.

Sia
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Chris Thierry
Top achievements
Rank 1
answered on 12 Jul 2011, 06:55 PM
OK, I'll use your idea, thank you for the project!
Are you planning to add this functionality in the next versions?
Thank you!
0
Sia
Telerik team
answered on 15 Jul 2011, 11:33 AM
Hello Chris Thierry,

Definitely! We plan to upgrade the visual appearance of our selection and hover interactivity to make them more visible and appealing. Thank you very much for your feedback.

Kind regards,
Sia
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Chris Thierry
Top achievements
Rank 1
answered on 15 Jul 2011, 01:35 PM
Perfect!, is there any way of associating this requirement with the solution?, for example if in the next release this issue is solved, I'll be notified by email? Because sometimes we fix the problem with a partial solution and then we don't remember any more or we don't change the code because with the partial solution is ok.

Thank you.
0
Sia
Telerik team
answered on 19 Jul 2011, 08:09 AM
Hi Chris Thierry,

I have logged this issue so now you can track it by pressing "track this issue" and it will appear under "Your tracked issues" when you log into with your credentials.

Best wishes,
Sia
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Chart
Asked by
Chris Thierry
Top achievements
Rank 1
Answers by
Chris Thierry
Top achievements
Rank 1
Sia
Telerik team
Share this question
or