Hi There,
I was wondering if there is anyway to just animate one wedge of the pie at a time? What I am trying to do is have a click event on a piece, which I have, and on that click event explode that piece of the pie. This all works fine at the moment, however when you click on a pieceit re-animates all the exploded pieces not just the changed piece.
Is there any way to make it only animate the piece that was clicked on and leave the rest as they are?
Thanks
Hello Nandakumar,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into and it will be great if you could send an isolated sample project for further investigation, because I am not completely sure how your data is organized and how exactly you show your hierarchy in the PieChart.
Feel free to write me if you have further questions.
Hi,
I am using XamWebChart & chart type is Pie Chart(Silverlight 4.0). I want to explode the piechart onclick of each item. Till now I am successfull and is working fine.
But I dont know how to add childrens for each item. If each item has some childrens then onclick of that item further it should explode.
Please suggest me the solution or some idea to achieve the same.
Thanks,
Nandakumar
This is a follow up. If you have any questions, please feel free to reply.
Thank you,
Sam
One way to achieve this is to remove the other animations when a point is being animated to the exploded position.
private void xamWebChart1_DataItemMouseLeftButtonDown(object sender, Infragistics.Silverlight.Chart.DataItemMouseEventArgs e) { FrameworkElement ele = e.Element as FrameworkElement; if (ele != null) { Dictionary<Type, object> tags = ele.Tag as Dictionary<Type, object>; if (tags != null && tags.ContainsKey(typeof(DataPoint))) { DataPoint dp = tags[typeof(DataPoint)] as DataPoint; Series s = null; if (tags.ContainsKey(typeof(Series))) { s = (Series)tags[typeof(Series)]; var animToRemove = (from otherdp in s.DataPoints from param in otherdp.ChartParameters where otherdp != dp && param.Type == ChartParameterType.ExplodedAnimation select new { otherdp, param }).ToList(); foreach (var toRemove in animToRemove) { toRemove.otherdp.ChartParameters.Remove(toRemove.param); } } var anim = from param in dp.ChartParameters where param.Type == ChartParameterType.ExplodedAnimation select param; var animParam = anim.FirstOrDefault(); if (animParam == null) { var animation = new Animation() { Sequential = true, BeginTime = TimeSpan.FromTicks(0), Duration = new Duration(TimeSpan.FromMilliseconds(250)) }; animParam = new ChartParameter( ChartParameterType.ExplodedAnimation, animation); dp.ChartParameters.Add(animParam); } var explode = from param in dp.ChartParameters where param.Type == ChartParameterType.Exploded select param; var explodeParam = explode.FirstOrDefault(); if (explodeParam == null) { explodeParam = new ChartParameter(ChartParameterType.Exploded, true); dp.ChartParameters.Add(explodeParam); } else { explodeParam.Value = !(bool)explodeParam.Value; } } } }
Hope this helps!-Graham