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
Chart re-sizing on different machines
Chart re-sizing on different machines
- Attachments
-
- Laptop.jpg (160.35 KiB) Viewed 4559 times
-
- desktop.jpg (131.25 KiB) Viewed 4520 times
Re: Chart re-sizing on different machines
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?
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Chart re-sizing on different machines
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
where
Have not tested it on all screens but on 2 or 3 seems ok.
Code: Select all
LeftAlignCharts([Chart1,Chart2],8,Form1.Width - 28);
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;
Re: Chart re-sizing on different machines
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.
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |