Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TChart XE6 FMX slow


This question is answered.


Permlink Replies: 4 - Last Post: Sep 17, 2014 7:17 AM Last Post By: Andrea Nini
Andrea Nini

Posts: 3
Registered: 9/20/99
TChart XE6 FMX slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 30, 2014 7:56 AM
I've already posted this question, but I can't find the thread:

I've created a FMX project with Delphi XE6, with a TChart component: I've added ~3000 values (date / double) and created a chart, if I compile for Win-32 the result is fast (I can zoom and scroll the chart without any problem), but if I compile for Android, and run on an Android smartphone, the zoom is really slow (the selection rectangle moves only every twenty seconds), and I haven't find a way to scroll it.

I've reduced the number of values to ~100, but the result is the same.

Someone has some advices?

Thanks,
Andrea
Yeray Alonso

Posts: 75
Registered: 6/12/11
Re: TChart XE6 FMX slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 1, 2014 12:21 AM   in response to: Andrea Nini in response to: Andrea Nini
Hi Andrea,

Andrea Nini wrote:
I've already posted this question, but I can't find the thread:

I think they have done some maintenance here. I can't find some old threads I was following either.

Andrea Nini wrote:
I've created a FMX project with Delphi XE6, with a TChart component: I've added ~3000 values (date / double) and created a chart, if I compile for Win-32 the result is fast (I can zoom and scroll the chart without any problem), but if I compile for Android, and run on an Android smartphone, the zoom is really slow (the selection rectangle moves only every twenty seconds), and I haven't find a way to scroll it.

I've reduced the number of values to ~100, but the result is the same.

Someone has some advices?

Have you tried setting this?

Chart1.BufferedDisplay := True;


--
Best Regards

Yeray Alonso
Steema Support Central
Follow us in Twitter and Facebook

"Important note: If you are a TeeChart registered customer,
please post your support questions at Steema's Support
monitored Forums for a prompter reply."
http://support.steema.com
Andrea Nini

Posts: 3
Registered: 9/20/99
Re: TChart XE6 FMX slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 1, 2014 5:55 AM   in response to: Yeray Alonso in response to: Yeray Alonso
Yeray Alonso wrote:

Chart1.BufferedDisplay := True;

Tried, but the result is the same.

--
Andrea
David Berneda

Posts: 205
Registered: 5/5/98
Re: TChart XE6 FMX slow
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 15, 2014 1:47 AM   in response to: Andrea Nini in response to: Andrea Nini
Andrea Nini wrote:

Yeray Alonso wrote:

Chart1.BufferedDisplay := True;

Tried, but the result is the same.

Next TeeChart update (for all ides including XE7, planned to release
very soon) has a better speed due to internal changes on painting text.

The XE7 FMX GPU Canvas for Android and iOS has also better speed for
several graphical methods like gradients.

The problem in Android or iOS is the GPU hardware graphics speed is 10
times slower than a normal win32 or win64 PC graphics card.

Painting the chart zoom rectangle while dragging/touching the screen
forces many consecutive repaints of the full chart.

On the PC this is not a big problem as every repaint takes aprox 20
milliseconds but in mobile/tablet this is 10 * 20 = 200 msec or more.

Painting Texts (axis labels, legend items, etc) is the slowest part and
its now much better with the latest code.

Another improvement is, with the latest TChart FMX Canvas its now
possible to set Chart1.BufferedDisplay:=True with the same (good)
visual quality.

This is very important because in Android/iOS (different than Windows),
every time something needs to be repainted (like a single chart), FMX
repaints the full screen, not only the chart.

So depending on what else is on the same form, the time it takes to
repaint the chart is the sum of all the controls in the form.

With BufferedDisplay=True the chart creates an internal bitmap to reuse
the last chart content instead of repainting every thing again.
This is also how VCL works by default.

Painting that internal bitmap is quite fast compared to drawing all the
chart contents. On iOS/Android the bitmap size (the chart width by
height) has to be multiplied by a default Canvas.Scale that its
usually 2 or more in "retina" screens.

Recent tests on a Nexus 4 phone and 7 tablet, shows the
frames-per-second for a simple chart have increased from 4 or 5 to 19.
We'll keep trying to make it faster.

For the zoom rectangle, I'd like to test if its possible to use an
alternate canvas layer on top of the chart instead of drawing directly
onto the chart canvas. Now that the BufferedBitmap=True works fine, it
should maybe be practical to do so and I guess it can run much faster.

Another approach for mobile zoom will be using a "pinch" gesture, or a
two-step finger tap (one to set the start zoom rectangle corner
position and another for opposite corner), so only 2 chart repaints
will be necessary.

regards !
david
www.teechart.com
Andrea Nini

Posts: 3
Registered: 9/20/99
Re: TChart XE6 FMX slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 17, 2014 7:17 AM   in response to: David Berneda in response to: David Berneda
David Berneda wrote:
Andrea Nini wrote:

Yeray Alonso wrote:

Chart1.BufferedDisplay := True;

Tried, but the result is the same.

Next TeeChart update (for all ides including XE7, planned to release
very soon) has a better speed due to internal changes on painting text.

I've just installed XE7 and indeed this solves the speed problem. Now it's as fast as the destkop version.

It remains only the scroll problem, but now it's usable, thanks,

Andrea
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02