Re-calibrating Axis Labels when Exporting...

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Steve Maughan
Newbie
Newbie
Posts: 13
Joined: Mon Jun 25, 2007 12:00 am

Re-calibrating Axis Labels when Exporting...

Post by Steve Maughan » Mon Mar 09, 2009 3:15 pm

I'm adding chart image exporting capabilities to my application. One of the features is that the user can select the size of the resulting image. The code is relatively straightforward. However when the source chart is much bigger than the resulting image, the axis labels get "scrunched up". See below:

Image

Here is a demo project to illustrate what I'm doing:

http://www.cozmix.com/misc/tchartscale.zip

What I would like would be for the axis label to re-calibrate on the exported image like they do when you reduce the size of a TChart e.g.

Image

Is this possible? I hope there's a way to do this!

Thanks,

Steve

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

Post by Yeray » Tue Mar 10, 2009 12:54 pm

Hi Steve,

I've tested your sample application and I've seen that using Assign method causes some strange behavior with the axes.

I've added this to be revised for further releases (TV52013950), but in the meanwhile, please use the following code instead of Assign method. This seems to work fine:

Code: Select all

  With xChart do
    begin
      ColorPaletteIndex := Chart1.ColorPaletteIndex;
      Foot       := Chart1.Foot;
      Legend     := Chart1.Legend;
      SubFoot    := Chart1.SubFoot;
      SubTitle   := Chart1.SubTitle;
      Title      := Chart1.Title;
      Walls      := Chart1.Walls;
    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

Steve Maughan
Newbie
Newbie
Posts: 13
Joined: Mon Jun 25, 2007 12:00 am

Post by Steve Maughan » Tue Mar 10, 2009 1:08 pm

Yeray,

Thanks for looking into it. I have tested the solution and it seems to work - many thanks. However, I don't understand how you can assign object pointers, free the object and not have an AV. For example, will Chart1.Foot etc be freed when xChart is freed?

Cheers,

Steve

Steve Maughan
Newbie
Newbie
Posts: 13
Joined: Mon Jun 25, 2007 12:00 am

Post by Steve Maughan » Tue Mar 10, 2009 2:55 pm

Yeray,

On further investigation I realize that (of course) the Axis formats are not copied. So this is definitely a high priority fix for me. Hotfixes are welcome!

Thanks,

Steve

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Mar 10, 2009 3:48 pm

Hi Steve,
However, I don't understand how you can assign object pointers, free the object and not have an AV. For example, will Chart1.Foot etc be freed when xChart is freed?
No, Chart1.Foot will be freed by Chart1's destructor when it's freed.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Steve Maughan
Newbie
Newbie
Posts: 13
Joined: Mon Jun 25, 2007 12:00 am

Post by Steve Maughan » Thu Mar 19, 2009 3:18 pm

9348257 wrote:I've added this to be revised for further releases (TV52013950)....
Has this bug been fixed? It's getting really quite urgent. Any idea when it will be fixed?

Thanks,

Steve

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Mar 20, 2009 11:38 am

Hi Steve,

The issue hasn't been fixed yet nor I can provide an estimate date at the present moment. In the meantime you can use the workaround Yeray suggested.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Steve Maughan
Newbie
Newbie
Posts: 13
Joined: Mon Jun 25, 2007 12:00 am

Post by Steve Maughan » Fri Mar 20, 2009 11:41 am

Thanks for the reply. The work around does not copy all of the properties over e.g. the axis format and min max properties are not copied. So I really would like to see a fix for this problem.

Many thanks,

Steve Maughan

Post Reply