Mega Search
23.2 Million


Sign Up

Make a donation  
TChart XE6 FMX slow  
News Group: embarcadero.public.delphi.reporting-charting

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

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 30-Aug-2014, at 7:56 AM EST
From: Andrea Nini
 
Re: TChart XE6 FMX slow  
News Group: embarcadero.public.delphi.reporting-charting
> {quote:title=David Berneda wrote:}{quote}
> Andrea Nini wrote:
> 
> > > {quote:title=Yeray Alonso wrote:}{quote}
> > > 
> > > {code}
> > > Chart1.BufferedDisplay := True;
> > > {code}
> > 
> > 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

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 17-Sep-2014, at 7:17 AM EST
From: Andrea Nini
 
Re: TChart XE6 FMX slow  
News Group: embarcadero.public.delphi.reporting-charting
Andrea Nini wrote:

> > {quote:title=Yeray Alonso wrote:}{quote}
> > 
> > {code}
> > Chart1.BufferedDisplay := True;
> > {code}
> 
> 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

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Sep-2014, at 1:47 AM EST
From: David Berneda
 
Re: TChart XE6 FMX slow  
News Group: embarcadero.public.delphi.reporting-charting
> {quote:title=Yeray Alonso wrote:}{quote}
> 
> {code}
> Chart1.BufferedDisplay := True;
> {code}

Tried, but the result is the same.

-- 
  Andrea

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 1-Sep-2014, at 5:55 AM EST
From: Andrea Nini
 
Re: TChart XE6 FMX slow [Edit]  
News Group: embarcadero.public.delphi.reporting-charting
Hi Andrea,

> {quote:title=Andrea Nini wrote:}{quote}
> 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.

> {quote:title=Andrea Nini wrote:}{quote}
> 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?

{code}
Chart1.BufferedDisplay := True;
{code}

--
Best Regards

Yeray Alonso
Steema Support Central
Follow us in [url=http://twitter.com/SteemaSoftware]Twitter[/url] and [url=https://www.facebook.com/SteemaSoftware]Facebook[/url]

"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

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 1-Sep-2014, at 12:22 AM EST
From: Yeray Alonso