Chart Legend Items

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

    Posted 21 Oct 2010 Link to this post

    Hi,
        I'm using a piechart generating items automatically. How can I access to this collection of items? if I try to use:

    myChart.DefaultView.ChartLegend.Items but the count is always 0

    Another question: Can I remove the legend click event keeping only the item click?, for example I want to click in a piechart item, the item become exploded but I don't want the same efect if user click on the legend item.  

    Thank you.

  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 22 Oct 2010 Link to this post

    Hello Chris Thierry,

    Due to the specifics of the legend control (we wanted the user to be able to add manually legend items even when the rest are auto-generated -- this is basically not supported out-of-the-box by the WPF/Silverlight control), you need to cast the ChartLegend to its base type to access the items like this (you can call this in the DataBound event handler for example):

    (myChart.DefaultView.ChartLegend as ItemsControl).Items

    Hope this helps.


    All the best,
    Freddie
    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
  3. DevCraft banner
  4. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 22 Oct 2010 Link to this post

    OK thanks for your answer.
    What about the second question?
    Thank you.
  5. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 27 Oct 2010 Link to this post

    Hi Chris,

    Unfortunately this functionality is not supported at the moment -- it is not possible to restrict the interactivity within the series items only and not the legend items as well.

    We will forward your feedback to our developers so they can consider implementing such option for one of the next versions of the control.


    Regards,
    Freddie
    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
  6. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 27 Oct 2010 Link to this post

    Thank you!
    Do you know if in the next version we will be able to create a pie chart with an item already exploded?
    Thank you again
  7. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 29 Oct 2010 Link to this post

    Hi Chris,

    This will be possible -- find attached a sample application that uses the BETA binaries and demonstrates how you can achieve the desired effect.

    Hope this helps.


    Kind regards,
    Freddie
    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
  8. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 29 Oct 2010 Link to this post

    Thank you very much!!!
Back to Top
DevCraft banner