0

i found my question exactly here: Disable Animation in ModernUI Charts

but it´s not answered.

I´m programming a (Mvvm) Application und wanted to use Torsten Mandelkows MetroChart. It´s finally running (after many mistakes) but now the Gauge Chart is extremly slow until its final worth.

For example its needs nearly 20 seconds to reach 50%. Is there a way to reach its final worth immediatly?

Here my Snippets:

View:

    <Viewbox Height="190">
            <metroChart:RadialGaugeChart Background="{x:Null}" ChartTitle="Einzelteile" ChartSubTitle="" Foreground="LightGray" Height="300" Width="300" Margin="0,0,0,0" >
                <metroChart:RadialGaugeChart.Series>
                    <metroChart:ChartSeries
                    DisplayMember="Title"
                    ItemsSource="{Binding Status}"
                    SeriesTitle="Status"
                    HorizontalAlignment="Stretch"
                    ValueMember="Percent" 
                    VerticalAlignment="Stretch">
                    </metroChart:ChartSeries>
                </metroChart:RadialGaugeChart.Series>
            </metroChart:RadialGaugeChart>
        </Viewbox>`

ViewModel:

...

            Status c = new Status();
            c.Title = "Parts";
            if (RecievedArticle != null) c.Percent = RecievedArticle.CalcPercentStatus();
            Status.Add(c);
...
public ObservableCollection<Status> Status { get; private set; } = new ObservableCollection<Status>();
}

public class Status
{
    public string Title { get; set; }
    public int Percent { get; set; }

}

`

Keke
  • 47
  • 7

1 Answers1

0

I found a way to speed it up. Think its a pretty dirty solution but works for me:

in TorstenMandelkow.MetroChart is a class named RadialGaugePiece

i edited two Methods:

    public RadialGaugePiece()
{
  //this.timer = new DispatcherTimer();
  //this.timer.Tick += new EventHandler(this.timer_Tick);
  this.Loaded += new RoutedEventHandler(this.RadialGaugePiece_Loaded);
}

    private void UpdatePie()
{
  if (this.AnimatedValue == this.Value)
    return;
  this.animationCounter = 0.0;
  this.animationStartValue = this.AnimatedValue;
        //this.timer.Interval = TimeSpan.FromMilliseconds(33.3);
    this.timer.Interval = TimeSpan.FromMilliseconds(0);
        this.timer.Start();
  this.Tick();
}
Keke
  • 47
  • 7