Chart Legend items style

7 posts, 0 answers
  1. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 07 Jul 2011 Link to this post

    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.
  2. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 12 Jul 2011 Link to this post

    Please, I need a solution for this.
    Thank you.
  3. DevCraft banner
  4. Sia
    Admin
    Sia avatar
    667 posts

    Posted 12 Jul 2011 Link to this post

    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!

  5. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 12 Jul 2011 Link to this post

    OK, I'll use your idea, thank you for the project!
    Are you planning to add this functionality in the next versions?
    Thank you!
  6. Sia
    Admin
    Sia avatar
    667 posts

    Posted 15 Jul 2011 Link to this post

    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!

  7. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 15 Jul 2011 Link to this post

    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.
  8. Sia
    Admin
    Sia avatar
    667 posts

    Posted 19 Jul 2011 Link to this post

    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!

Back to Top
DevCraft banner