XE11Delphi + TeeChart + High DPI
XE11Delphi + TeeChart + High DPI
I like to use TeeChart together with high DPI awareness.
I've found no document about it, also the help is not helpful.
So how to set up Teechart in a XE11 IDE environment correctly to get a correct display for different monitors and different user Windows scalings? Which actions are done automatically, which actions have to be done by programming.
Examples: font sizes, e.g. of legend, thickness of lines and all other stuff.
Is TeeChart aware about DPI settings?
BR
Uli
I've found no document about it, also the help is not helpful.
So how to set up Teechart in a XE11 IDE environment correctly to get a correct display for different monitors and different user Windows scalings? Which actions are done automatically, which actions have to be done by programming.
Examples: font sizes, e.g. of legend, thickness of lines and all other stuff.
Is TeeChart aware about DPI settings?
BR
Uli
Re: XE11Delphi + TeeChart + High DPI
Hello,
Yes, TeeChart should be DPI aware. Find here a discussion and a test project about the subject.
Yes, TeeChart should be DPI aware. Find here a discussion and a test project about the subject.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: XE11Delphi + TeeChart + High DPI
Hello Yeray,
please let me come back to the high DPI question.
Here is the DisplaySize example with a checkbox in the legend. The snapshot is taken from a 300% scaling on a high DPI monitor.
As you can see the checkbox is far from usable. Also the icons in the bar get unreadable. The images do not properly scale.
In a setup with 2 screens with different resolutions the program should be aware about the change of scaling and/or resolution (shift of GUI between monitors). Therefore the program or here better chart must get information about a change.
Possible you do this by the ChangeScale procedure as mentioned in https://www.steema.com/support/viewtopi ... 188#p78188
But by the DisplaySize example the setting of the font sizes is just by a button click and not an automatic reaction on a screen scaling.
And as the example shows the checkboxes are not touched in any way.
Any idea for a solution?
Best wishes
Uli
please let me come back to the high DPI question.
Here is the DisplaySize example with a checkbox in the legend. The snapshot is taken from a 300% scaling on a high DPI monitor.
As you can see the checkbox is far from usable. Also the icons in the bar get unreadable. The images do not properly scale.
In a setup with 2 screens with different resolutions the program should be aware about the change of scaling and/or resolution (shift of GUI between monitors). Therefore the program or here better chart must get information about a change.
Possible you do this by the ChangeScale procedure as mentioned in https://www.steema.com/support/viewtopi ... 188#p78188
But by the DisplaySize example the setting of the font sizes is just by a button click and not an automatic reaction on a screen scaling.
And as the example shows the checkboxes are not touched in any way.
Any idea for a solution?
Best wishes
Uli
Re: XE11Delphi + TeeChart + High DPI
Hello Yeray,
do you have any answer for my DPI problem (legend checkboxes)?
Best wishes
Uli
do you have any answer for my DPI problem (legend checkboxes)?
Best wishes
Uli
Re: XE11Delphi + TeeChart + High DPI
Hello Uli,
The "Set all fonts" button in the DisplaySize example was an attempt to find a workaround when I wasn't able to find a proper
I'll revise the legend checkbox and the commander icons. Doesn't the rest of the chart adapt correctly to the scale changes for you with that
The "Set all fonts" button in the DisplaySize example was an attempt to find a workaround when I wasn't able to find a proper
ChangeScale
implementation. However, that last code should work fine when moving a chart between screens with different scales.I'll revise the legend checkbox and the commander icons. Doesn't the rest of the chart adapt correctly to the scale changes for you with that
ChangeScale
implementation?Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: XE11Delphi + TeeChart + High DPI
A simple line series with pen width = 1 gets very thin on a high DPI monitor. So actually I try to help myself by Pen.Width := nominal_pen_width * Screen.PixelsPerInch / 96 as a quick turnaround.
But again it shows that TeeChart is not consistent regarding High DPI.
As I only see my application I cannot tell you about all the obstacles. So you may need to check the library more deeply.
I expect from time to time to stumble across a next problem
Best wishes
Uli
But again it shows that TeeChart is not consistent regarding High DPI.
As I only see my application I cannot tell you about all the obstacles. So you may need to check the library more deeply.
I expect from time to time to stumble across a next problem
Best wishes
Uli
Re: XE11Delphi + TeeChart + High DPI
Hello Uli,
I've already corrected the legend checkboxes at #2501.
It doesn't look bad for me at 150%: But you could try to override the
ChangeScale
method and change the series pen width there.Yes, I'm afraid we haven't tested all the possibilities and there are chances that we are missing something.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: XE11Delphi + TeeChart + High DPI
Hello Yeray,
1.
great to read about the fix but where do I get it?
2.
How to override ChangeScale? I'm reluctant to change library source codes as with a next library update the problems start ... (is the update a solution or not, do I need to change my own code ... ?)
Best wishes
Uli
1.
great to read about the fix but where do I get it?
2.
How to override ChangeScale? I'm reluctant to change library source codes as with a next library update the problems start ... (is the update a solution or not, do I need to change my own code ... ?)
Best wishes
Uli
Re: XE11Delphi + TeeChart + High DPI
Addendum: take a look at a a line of pen width = 1 on a monitor with resolution 3840 * 2160
Re: XE11Delphi + TeeChart + High DPI
Hello,
We're in contact with Uli by mail, but I'd like to reply here in case other customers find this.
We're in contact with Uli by mail, but I'd like to reply here in case other customers find this.
The fix is included in TeeChart v2022.34 published yesterday.
See
TControl.ChangeScale
at docwiki. Sice TForm inherits TControl, you can override it and change whatever you want there. Ie:Code: Select all
type
TForm1 = class(TForm)
//...
private
procedure ChangeScale(M, D: Integer{$IFDEF D24}; isDpiChange: Boolean{$ENDIF}); override;
//...
procedure TForm1.ChangeScale(M, D: Integer{$IFDEF D24}; isDpiChange: Boolean{$ENDIF});
var i: Integer;
begin
inherited;
if not (csLoading in Self.ComponentState) and (M <> D) then
begin
for i:=0 to Chart1.SeriesCount-1 do
Chart1[i].Pen.Width:=MulDiv(Chart1[i].Pen.Width, M, D);
end;
end;
I have a fix proposal on the works.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |