private static bool TryRunSweepAngleAnimtation(PieSeries series) { double sweepAngle = (double)series.GetAnimationBaseValue(ChartAnimationUtilities.SweepAngleProperty); if (double.IsNaN(sweepAngle)) { series.SetValue(ChartAnimationUtilities.SweepAngleProperty, series.AngleRange.SweepAngle); sweepAngle = series.AngleRange.SweepAngle; } DoubleAnimation animation = new DoubleAnimation(); animation.From = 0.0; animation.To = sweepAngle; animation.Duration = AnimationDuration; animation.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut, }; Storyboard.SetTargetProperty(animation, new PropertyPath(ChartAnimationUtilities.SweepAngleProperty)); Storyboard.SetTarget(animation, series); Storyboard storyboard = new Storyboard(); storyboard.Children.Add(animation); return(Run(storyboard, series)); }
public async void ExcecuteLoadDataCommand() { RequestIsWorking = true; if (GlobalVariables.ServerIsOnline) { HttpResponseMessage resp = await Client.GetAsync(GlobalVariables.BackendServer_URL + $"/api/auswertung/dividendenErhalten/Gesamt/Wertpapiere?jahrVon={jahrvon}&jahrBis={jahrbis}"); if (resp.IsSuccessStatusCode) { ItemList = await resp.Content.ReadAsAsync <ObservableCollection <DividendeWertpapierAuswertungModel> >(); } PieSeries <double>[] series = new PieSeries <double> [ItemList.Count]; int index = 0; ItemList.ToList().ForEach(a => { series.SetValue(new PieSeries <double> { Values = new double[] { a.Betrag }, Name = a.Bezeichnung, TooltipLabelFormatter = (point) => string.Format("{0} {1:N2}€ ", a.Bezeichnung, point.PrimaryValue) }, index); index++; }); Series = series; RaisePropertyChanged(nameof(Series)); } RequestIsWorking = false; RaisePropertyChanged("ItemList"); }
private static bool TryRunSweepAngleAnimtation(PieSeries series) { double sweepAngle = (double)series.GetAnimationBaseValue(ChartAnimationUtilities.SweepAngleProperty); if (double.IsNaN(sweepAngle)) { series.SetValue(ChartAnimationUtilities.SweepAngleProperty, series.AngleRange.SweepAngle); sweepAngle = series.AngleRange.SweepAngle; } DoubleAnimation animation = new DoubleAnimation(); animation.From = 0.0; animation.To = sweepAngle; animation.Duration = AnimationDuration; animation.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut, }; Storyboard.SetTargetProperty(animation, new PropertyPath(ChartAnimationUtilities.SweepAngleProperty)); Storyboard.SetTarget(animation, series); Storyboard storyboard = new Storyboard(); storyboard.Children.Add(animation); return Run(storyboard, series); }