Animation popup on pie chart

4 posts, 0 answers
  1. Khiem
    Khiem avatar
    4 posts
    Member since:
    Jan 2012

    Posted 05 Feb 2012 Link to this post

    Hi,
    I want to show an animation popup for each label on pie chart like Kendo chart: http://demos.kendoui.com/dataviz/pie-chart/remote-data.html 

    I'm thinking of using behavior to do this, also i want to high light each part on mouse over event.
    Please anyone can help me

    Thank you
  2. Sia
    Admin
    Sia avatar
    667 posts

    Posted 08 Feb 2012 Link to this post

    Hello,

    We do not provide built-in support for such functionality with our RadChart for Silverlight. What I can suggest is to check the interactivity settings, and you can try the exposed HoverChanged event. You just need to find the hovered item in code behind and set its labels visibility to Visible (and collapse all others).

    public MainPage()
    {
     InitializeComponent();
      
     this.radChart.SeriesMappings[0].SeriesDefinition.InteractivitySettings.HoverScope = InteractivityScope.Item;
     this.radChart.DefaultView.ChartArea.HoverChanged += new EventHandler<ChartHoverChangedEventArgs>(ChartArea_HoverChanged);
    }
      
    void ChartArea_HoverChanged(object sender, ChartHoverChangedEventArgs e)
    {
     ChartArea chartArea = sender as ChartArea;
      
     if (chartArea == null)
     {
      return;
     }
      
     var hoveredDataItems = e.HoveredItems.Select(dp => dp.DataItem);
      
     foreach (var item in chartArea.ChildrenOfType<SeriesItemLabel>())
     {
      if (hoveredDataItems.Contains(item.DataPoint.DataItem))
      {
       item.Visibility = Visibility.Visible;
      }
      else
      {
       item.Visibility = Visibility.Collapsed;
      }
     }
    }

    There is one additional setting related to the hover effects that can be set on global level - RadChart.HoverActivationDelay. This property gets or sets the delay before the hover effect is activated (by default there is no delay and the hover effect becomes active immediately).

    All the best,
    Sia
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Khiem
    Khiem avatar
    4 posts
    Member since:
    Jan 2012

    Posted 09 Feb 2012 Link to this post

    Thanks for your help, 
    Have you any idea about an animation for Item label once you move between Items?

  5. Sia
    Admin
    Sia avatar
    667 posts

    Posted 13 Feb 2012 Link to this post

    Hello,

    Can you please describe in more details what is the needed behavior?

    Thank you in advance,
    Sia
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top