TeeChart Speed on IOS
TeeChart Speed on IOS
Hi Narcis,
I need your help again.
I have read and applied the "Real-time Charting article" and it did not solve the speed problem.
In fact i compared the loading time : "No optimization VS Optimization" the difference in my case is around 10 ms.
Then i noticed that the problem is not at all in loading the data!
In fact i have the feeling that the CPU is tremendously used !.
When i press a button on the same form as the TChart it responds but after a very long period of time : 10 Seconds Just to show a "Hello" message !.
Then, since i can not debug in the Mac side, i tried to debug In windows side ( where there is no speed problem at all !) .
By putting a showmessage on BeforeDraw and on AfterDraw i noticed that drawing keeps get called every time, as soon as you move the mouse, consuming CPU which is ok on windows but not on ios. Please note that no data has been modified or a form resized, just moving the mouse !
I hope that you can find a workaround to not let the TChart be redrawed unnecessarily !
Thanks
r.lebbar
I need your help again.
I have read and applied the "Real-time Charting article" and it did not solve the speed problem.
In fact i compared the loading time : "No optimization VS Optimization" the difference in my case is around 10 ms.
Then i noticed that the problem is not at all in loading the data!
In fact i have the feeling that the CPU is tremendously used !.
When i press a button on the same form as the TChart it responds but after a very long period of time : 10 Seconds Just to show a "Hello" message !.
Then, since i can not debug in the Mac side, i tried to debug In windows side ( where there is no speed problem at all !) .
By putting a showmessage on BeforeDraw and on AfterDraw i noticed that drawing keeps get called every time, as soon as you move the mouse, consuming CPU which is ok on windows but not on ios. Please note that no data has been modified or a form resized, just moving the mouse !
I hope that you can find a workaround to not let the TChart be redrawed unnecessarily !
Thanks
r.lebbar
Re: TeeChart Speed on IOS
Hi r.lebbar,
I'm trying to reproduce this in XE2 and the actual sources in a Win7 x64 machine but it seems to work fine for me here. Find attached the application I'm using. When the application starts, I see a call to both OnBeforeDrawChart and OnAfterDraw events but not when I move the mouse over the chart once it is shown.rlebbar wrote:By putting a showmessage on BeforeDraw and on AfterDraw i noticed that drawing keeps get called every time, as soon as you move the mouse, consuming CPU which is ok on windows but not on ios. Please note that no data has been modified or a form resized, just moving the mouse !
I hope that you can find a workaround to not let the TChart be redrawed unnecessarily !
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeeChart Speed on IOS
Hi Yeray
Please look at this image !
Thanks
Please look at this image !
Thanks
- Attachments
-
- Your Project
- Event.png (163.43 KiB) Viewed 35574 times
Re: TeeChart Speed on IOS
Hi r.lebbar,
This is not just moving the mouse over the chart but pressing the left mouse button down and then moving the mouse to draw the zoom rectangle, isn't it?
To draw the zoom rectangle, the chart has to be redrawn.
This is not just moving the mouse over the chart but pressing the left mouse button down and then moving the mouse to draw the zoom rectangle, isn't it?
To draw the zoom rectangle, the chart has to be redrawn.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeeChart Speed on IOS
Hi Yeray
Sorry Yeray, This is JUST MOVING THE MOUSE over the chart : No Click, No left Button, No Right Button !
Thanks
Sorry Yeray, This is JUST MOVING THE MOUSE over the chart : No Click, No left Button, No Right Button !
Thanks
Re: TeeChart Speed on IOS
Hi Yeray
I have not noticed a rectangle in the back that stays active
Please find the exe i have generated with your code
Thanks
I have not noticed a rectangle in the back that stays active
Please find the exe i have generated with your code
Thanks
- Attachments
-
- iOS test.zip
- (3.62 KiB) Downloaded 1604 times
Re: TeeChart Speed on IOS
Hi Yearay
The Exe Project was not allowed to be uploaded.
Thanks
The Exe Project was not allowed to be uploaded.
Thanks
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart Speed on IOS
Hello,
If compressing it in a zip/rar package doesn't fit in the maximum upload size (512 kb) please upload it at http://www.steema.net/upload/.
Thanks in advance.
If compressing it in a zip/rar package doesn't fit in the maximum upload size (512 kb) please upload it at http://www.steema.net/upload/.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TeeChart Speed on IOS
Hi Narcis,
I have uploaded the exe file as indicated.
Please in the mean time what about the ios device, since i am more interested in the ios than the windows projects
Thanks
I have uploaded the exe file as indicated.
Please in the mean time what about the ios device, since i am more interested in the ios than the windows projects
Thanks
Re: TeeChart Speed on IOS
Hi r.lebbar,
I'm still a little bit confused.
- The exe you sent us responds to me as I'd expect: before the first time the chart is going to be shows, both events are fired once. Then, once the chart is shown, I can move the window and move the mouse over the chart without clicking on it, and the events aren't fired. Only if I click on the chart, then it is redrawn and the events are fired again and again as I move the mouse because it needs to draw the zoom rectangle.
- In a real device, "moving the mouse over the chart without clicking on it" has no sense (at least I don't see it). So, if you are moving the finger around the chart *touching the chart*, the equivalent in windows would be clicking on the chart and moving the mouse. Then, as said above, by default, a zoom rectangle is being drawn and thus the charts is resized each time a mouse/finger displacement is being detected to draw a new zoom rectangle.
Try disabling the zoom feature:
I'm still a little bit confused.
- The exe you sent us responds to me as I'd expect: before the first time the chart is going to be shows, both events are fired once. Then, once the chart is shown, I can move the window and move the mouse over the chart without clicking on it, and the events aren't fired. Only if I click on the chart, then it is redrawn and the events are fired again and again as I move the mouse because it needs to draw the zoom rectangle.
- In a real device, "moving the mouse over the chart without clicking on it" has no sense (at least I don't see it). So, if you are moving the finger around the chart *touching the chart*, the equivalent in windows would be clicking on the chart and moving the mouse. Then, as said above, by default, a zoom rectangle is being drawn and thus the charts is resized each time a mouse/finger displacement is being detected to draw a new zoom rectangle.
Try disabling the zoom feature:
Code: Select all
Chart1.AllowZoom:=false;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeeChart Speed on IOS
Hi yeray
Sorry for the delay, i was out of town.
Please find a sample that will show you exactly what is happening
In my case then variable "NbreOfTimesTheChartIsDrawn" increments by 5 or 6 at each hit !
Thanks
r.lebbar
Sorry for the delay, i was out of town.
Please find a sample that will show you exactly what is happening
In my case then variable "NbreOfTimesTheChartIsDrawn" increments by 5 or 6 at each hit !
Thanks
r.lebbar
- Attachments
-
- Test.zip
- (4.26 KiB) Downloaded 1567 times
Re: TeeChart Speed on IOS
Hi r.lebbar,
Interesting. If I click on the button with the mouse it behaves as you describe (increments by 5 or 6 at each hit). But if I press the space bar (after one click with the mouse so the focus is in the button), the NbreOfTimesTheChartIsDrawn remains stable.
And the same happens if I use the chart Clicked event:
Could you please confirm with this the number of times the chart is drawn seems to be stable?
It would indicate that clicking the button makes the chart to be redrawn
Interesting. If I click on the button with the mouse it behaves as you describe (increments by 5 or 6 at each hit). But if I press the space bar (after one click with the mouse so the focus is in the button), the NbreOfTimesTheChartIsDrawn remains stable.
And the same happens if I use the chart Clicked event:
Code: Select all
procedure TForm1.Chart1Click(Sender: TObject);
begin
ShowMessageFmt('So far, the Chart has been drawn %d Times',[NbreOfTimesTheChartIsDrawn]);
end;
It would indicate that clicking the button makes the chart to be redrawn
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeeChart Speed on IOS
Hi Yeray
The OnChartClick seems to be more stable than the SpeedButtonClick.
But as you may notice when you click on the chart the very first time it gets redrawn once more (only the first click).
With the SpeedButtonClick it is worst since the Chart is redrawn more than 5 Times at each click.
Could you please help me get a very basic workaround since in my case there is no reason to let the chart be redrawn once the OnAfterDraw event is hit. So the question is how to freeze the chart ? (Not allowing it to be redrawn).
Thanks in advance.
r.lebbar
The OnChartClick seems to be more stable than the SpeedButtonClick.
But as you may notice when you click on the chart the very first time it gets redrawn once more (only the first click).
With the SpeedButtonClick it is worst since the Chart is redrawn more than 5 Times at each click.
Could you please help me get a very basic workaround since in my case there is no reason to let the chart be redrawn once the OnAfterDraw event is hit. So the question is how to freeze the chart ? (Not allowing it to be redrawn).
Thanks in advance.
r.lebbar
Re: TeeChart Speed on IOS
Hi r.lebbar,
TButton is also stable. It actually seems to be a non related TeeChart problem: if you remove the chart and use the Form OnPaint event instead of the chart OnBeforeDrawChart/OnAfterDraw events, it behaves exactly the same:
I've opened a ticket in Embarcadero's Quality Central. You can vote for it.
http://qc.embarcadero.com/wc/qcmain.aspx?d=104281
In the meanwhile I'd suggest you to use TButton instead of TSpeedButton.
TButton is also stable. It actually seems to be a non related TeeChart problem: if you remove the chart and use the Form OnPaint event instead of the chart OnBeforeDrawChart/OnAfterDraw events, it behaves exactly the same:
Code: Select all
procedure TForm1.FormPaint(Sender: TObject; Canvas: TCanvas;
const ARect: TRectF);
begin
Inc(NbreOfTimesTheChartIsDrawn);
end;
http://qc.embarcadero.com/wc/qcmain.aspx?d=104281
In the meanwhile I'd suggest you to use TButton instead of TSpeedButton.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeeChart Speed on IOS
Hi Yeray
Thanks for your help, I have finally a decent loading time !
By using a Private variable fIsAlreadyDrawn in the Form, one can do :
procedure TFChart.TestChartAfterDraw(Sender: TObject);
begin
fIsAlreadyDrawn := True;
end;
procedure TFChart.TestChartBeforeDrawChart(Sender: TObject);
begin
if fIsAlreadyDrawn Then Abort
end;
This works on Windows but not on the real IOS device.
Then I added a property variable IsAlreadyDrawn to the Chart in the FMI code.
It drops by arround 50% the necessary time to load the chart .
I know that this is just a workaround until a real solution is found.
Many Thanks.
r.lebbar
Thanks for your help, I have finally a decent loading time !
By using a Private variable fIsAlreadyDrawn in the Form, one can do :
procedure TFChart.TestChartAfterDraw(Sender: TObject);
begin
fIsAlreadyDrawn := True;
end;
procedure TFChart.TestChartBeforeDrawChart(Sender: TObject);
begin
if fIsAlreadyDrawn Then Abort
end;
This works on Windows but not on the real IOS device.
Then I added a property variable IsAlreadyDrawn to the Chart in the FMI code.
It drops by arround 50% the necessary time to load the chart .
I know that this is just a workaround until a real solution is found.
Many Thanks.
r.lebbar