Page 1 of 1

Animation example on Android

Posted: Tue Nov 13, 2012 12:27 pm
by 17064088
Hello,

I am trying to get animation working on my Android charts. I just need a simple grow animation on bar charts, but I cant find any example or tutorial on that.

This is what I came up with, but it doesnt do anything:

Code: Select all

        SeriesAnimation seriesAnimation = new SeriesAnimation();
        seriesAnimation.setActive(true);
        seriesAnimation.setStartAtMin(false);
        seriesAnimation.setSteps(500);
        seriesAnimation.setStartValue(0);
        seriesAnimation.setSeries(chart.getSeries(0));
        chart.getTools().add(seriesAnimation);

        try {
            seriesAnimation.execute();
        } catch (Exception e) {
            e.printStackTrace();
        }

Re: Animation example on Android

Posted: Wed Nov 14, 2012 8:34 am
by yeray
Hi,

Right, this tool works in Swing but in SWT nor in Android.
I've added it to the wish list to be implemented in future releases (TJ71016413).
Thanks for reporting it.

Re: Animation example on Android

Posted: Thu Nov 15, 2012 2:45 pm
by 17064088
I see.

How about panning - can I get some demo code on that? I tried this, but doesnt help:

Scroll scroll = new Scroll(chart.getChart());
scroll.setAllow(ScrollMode.BOTH);
chart.setPanning(scroll);

Re: Animation example on Android

Posted: Thu Nov 15, 2012 3:25 pm
by yeray
Hi
crni wrote:How about panning - can I get some demo code on that? I tried this, but doesnt help:
Yes, you can use the PanData tool as the features demo does:

Code: Select all

PanData panDataTool1 = new PanData(tChart1.getChart());
Note you have to copy the PanData.java file from the demo to your project's folder to use it.