Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1560 - Animations not working in Xamarin.Forms
Summary: Animations not working in Xamarin.Forms
Status: CONFIRMED
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Xamarin.Forms (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL: http://www.teechart.net/support/viewt...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-16 11:15 EDT by narcís calvet
Modified: 2016-10-04 02:29 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description narcís calvet 2016-06-16 11:15:50 EDT
Animations are not working in Xamarin.Forms as in WinForms.

This WinForms code works:

    public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }

    Steema.TeeChart.Animations.ChartPartAnimation animation;

    private void InitializeChart()
    {
      var series = new Steema.TeeChart.Styles.Points(tChart1.Chart);
      series.FillSampleValues();

      animation = new Steema.TeeChart.Animations.ChartPartAnimation(tChart1.Chart);
      animation.Series = series;
      animation.EasingFunction = new Steema.TeeChart.Animations.EasingFunctions.BounceEase();
      animation.EasingMode = Steema.TeeChart.Animations.EasingFunctions.EasingMode.EaseOut;
      animation.Target = Steema.TeeChart.ChartClickedPartStyle.SeriesPointer;
      animation.TranslateStyle = Steema.TeeChart.Animations.TransformTranslate.FromRight;

      var timer1 = new Timer();
      timer1.Interval = 3000;
      timer1.Tick += Timer1_Tick;
      timer1.Start();
    }

    private void Timer1_Tick(object sender, EventArgs e)
    {
      animation.Play();
    }


While the same in Xamarin.Forms doesn't:

    Steema.TeeChart.Chart tChart1;
    const int NumPoints = 50;
    const int MinValue = 0;
    const int MaxValue = 1000;

    Steema.TeeChart.Animations.ChartPartAnimation animation;

    public App()
    {
      tChart1 = new Chart(this);
      tChart1.Aspect.View3D = false;

      var series = new Steema.TeeChart.Styles.Points(tChart1.Chart);
      series.FillSampleValues();

      animation = new Steema.TeeChart.Animations.ChartPartAnimation(tChart1.Chart);
      animation.Series = series;
      animation.EasingFunction = new Steema.TeeChart.Animations.EasingFunctions.BounceEase();
      animation.EasingMode = Steema.TeeChart.Animations.EasingFunctions.EasingMode.EaseOut;
      animation.Target = Steema.TeeChart.ChartClickedPartStyle.SeriesPointer;
      animation.TranslateStyle = Steema.TeeChart.Animations.TransformTranslate.FromRight;
      
      Device.StartTimer(TimeSpan.FromMilliseconds(3000), OnTimerTick);


      ChartView chartView = new ChartView
      {
        VerticalOptions = LayoutOptions.FillAndExpand,
        HorizontalOptions = LayoutOptions.FillAndExpand,

        WidthRequest = 400,
        HeightRequest = 500
      };

      chartView.Model = tChart1;

      MainPage = new ContentPage
      {
        Content = new StackLayout
        {
          Children = {
                    chartView,
                }
        },
      };
    }

    private bool OnTimerTick()
    {
      animation.Play();
      return true;
    }