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

Animation popup on pie chart

3 Answers 108 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Khiem
Top achievements
Rank 1
Khiem asked on 06 Feb 2012, 04:30 AM
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

3 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 08 Feb 2012, 09:04 PM
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 >>
0
Khiem
Top achievements
Rank 1
answered on 09 Feb 2012, 10:27 AM
Thanks for your help, 
Have you any idea about an animation for Item label once you move between Items?

0
Sia
Telerik team
answered on 13 Feb 2012, 07:32 PM
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 >>
Tags
Chart
Asked by
Khiem
Top achievements
Rank 1
Answers by
Sia
Telerik team
Khiem
Top achievements
Rank 1
Share this question
or