TChartEditor response time

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
toreba
Newbie
Newbie
Posts: 17
Joined: Thu Aug 07, 2014 12:00 am

TChartEditor response time

Post by toreba » Wed Apr 22, 2015 6:08 pm

Hi,

When the chart shows e.g. million data points, the chart editor becomes so slow that users think the software has crashed. With the chart editor's AutoRepaint property set to True, then just changing the series title causes many seconds of delay while the whole chart is redrawn. With the AutoRepaint property set to False, the chart closes and the application seems to hang while the chart is updated. In either mode the user has no visible indication that anything is happening, and the TChartEditor offers no events that we can use to show a wait cursor.

Is there anything that can be done to speed up chart regeneration? Are there other chart properties that can be set to improve performance? If we're changing only the series title through the chart editor, then only the legend needs to be redrawn, and that should be really quick.

Alternatively, could the TChartEditor support more events so that we can keep users informed during time-consuming operations?

Thanks for any advice.

Toreba

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TChartEditor response time

Post by Yeray » Thu Apr 23, 2015 8:44 am

Hi Toreba,

First of all, I'd suggest you to carefully read the post here.

Regarding the Editor, we always recommend to not allow the final user to access it. Note the editor is a tool designed to help the developers to build their charts writing less code; with the years, this tool has grown in complexity and it's quite easy to end in inconsistent configurations if manipulated by the wrong hands.

Regarding the legend repaints, I'm afraid chart and the legend are more linked than that and it would be difficult to separate their drawing routines. Ie, note the series title can be shown in the series marks, so changing the title needs to repaint the whole series.

Adding events to all the actions possible in the editor, or to all the actions that force a chart repaint, would be a lot of events.

I'd suggest you implement any tip possible for you from those in the post mentioned above. Also, you could change the cursor at OnBeforeDrawSeries and restore it at OnAfterDraw:

Code: Select all

procedure TForm1.Chart1BeforeDrawSeries(Sender: TObject);
begin
  Screen.Cursor:=crHourGlass;
end;

procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
  Screen.Cursor:=crDefault;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

toreba
Newbie
Newbie
Posts: 17
Joined: Thu Aug 07, 2014 12:00 am

Re: TChartEditor response time

Post by toreba » Thu Apr 23, 2015 1:18 pm

Yeray,

That's very helpful, thanks for your advice. I will certainly experiment with the options.

The chart editor is too useful to deny to users! Does the TChart version 'with source' include the source for the TChartEditor? Could I add events myself, and customize in other ways?

Regards

Toreba

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TChartEditor response time

Post by Yeray » Thu Apr 23, 2015 2:14 pm

Hello Toreba,
toreba wrote:The chart editor is too useful to deny to users!
It's useful, but too complicate for a regular user expecting things to be intuitive (IMHO).
toreba wrote:Does the TChart version 'with source' include the source for the TChartEditor? Could I add events myself, and customize in other ways?
Indeed!
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply