回复 9楼bj_zm的帖子
当前我调查的进展,在 PlotElementLoaded 事件中设置动画的方法:
- private void DataSeries_PlotElementLoaded(object sender, EventArgs e)
- {
- PlotElement pe = (PlotElement)sender;
- ScaleTransform st = new ScaleTransform();
- pe.RenderTransform = st;
- Duration duration = new Duration(TimeSpan.FromSeconds(5));
- Storyboard sb = new Storyboard { Duration = duration };
- DoubleAnimation da1 = new DoubleAnimation { To = 5.0, From = 1.0, AutoReverse = true };
- DoubleAnimation da2 = new DoubleAnimation { To = 5.0, From = 1.0, AutoReverse = true };
- Storyboard.SetTarget(da1, st);
- Storyboard.SetTargetProperty(da1, new PropertyPath("ScaleX"));
- sb.Children.Add(da1);
-
- Storyboard.SetTarget(da2, st);
- Storyboard.SetTargetProperty(da2, new PropertyPath("ScaleY"));
- sb.Children.Add(da2);
- sb.Begin();
- }
复制代码
当前无法获取 Chart 的 PlotElement 集合,正在询问产品组。 |