Chart re-sizing on different machines

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Barry
Newbie
Newbie
Posts: 2
Joined: Tue Nov 11, 2014 12:00 am

Chart re-sizing on different machines

Post by Barry » Tue Mar 03, 2015 11:30 am

HI,

I have an application that charts stock prices, on my desktop it looks perfect, as it does on all my colleagues desktops, please see desktop.jpg

However on my laptop or when a projector is connected to a PC changes size. I have tried locking the aspect ratio, preventing re-sizing etc nothing seems to work, pls see laptop.jpg

I would be grateful for any suggestions

Thanks

Barry
Attachments
Laptop.jpg
Laptop.jpg (160.35 KiB) Viewed 4461 times
desktop.jpg
desktop.jpg (131.25 KiB) Viewed 4422 times

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

Re: Chart re-sizing on different machines

Post by Yeray » Wed Mar 04, 2015 9:19 am

Hello,

I see the chart doesn't take all the form width.
Can you reproduce the problem in a new simple project? If so, could you please send it to us?
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

Barry
Newbie
Newbie
Posts: 2
Joined: Tue Nov 11, 2014 12:00 am

Re: Chart re-sizing on different machines

Post by Barry » Thu Mar 05, 2015 2:39 pm

I think I have sorted it, it looks like the chart does not keep its aspect ratio on different screen sorts so on a 1600 * 1200 screen it looks fine. However on a 1920*1080 screen it does not. What I had to do is work out the width of the form and then size the chart Dynamical using

Code: Select all

LeftAlignCharts([Chart1,Chart2],8,Form1.Width - 28);
where

Code: Select all

procedure TForm1.LeftAlignCharts(Const Charts: Array of TCustomChart; aLeft: Integer; aWidth: Integer);

// This procedure align's two charts on the form

var i: Integer;

begin
  for i := Low(Charts) to High(Charts) do
  With Charts[i] do
  begin
    Left := aLeft;
    MarginLeft := 0;
    Width := aWidth;
    Axes.Left.TitleSize := 15;
    Axes.Left.LabelsSize := 100;  // Needs to be big as numbers can run to millions
    Axes.Left.LabelsAlign := alDefault;
    Marginright := 1;    // This is in % not pixels
  end;
end;
Have not tested it on all screens but on 2 or 3 seems ok.

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

Re: Chart re-sizing on different machines

Post by Yeray » Fri Mar 06, 2015 9:06 am

Hello,

I'm glad to hear you found how to make it work fine.
If you still find problems with it, don't hesitate to let us know.
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