Bar series - text alignment issue in marks label

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Bar series - text alignment issue in marks label

Post by marder » Wed Sep 05, 2012 11:21 am

Hi.

I encountered a strange issue on one Windows XP machine
Image

It seems like the percent value shown in the marks is not correctly aligned.

I am using TeeChart Pro 2012.06.120613 with Delphi XE2.

Is this a known issue?

Note: This issue did not occur with TeeChart Pro V8 and Delphi 2010, which I used before updating to Delphi XE2.

Best regards.

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

Re: Bar series - text alignment issue in marks label

Post by Yeray » Thu Sep 06, 2012 7:54 am

Hi,

I'm getting the following with the code below and TeeChart Pro v2012.06, XE2 in a Win7 x64 machine:
Marks_align.png
Marks_align.png (31.29 KiB) Viewed 14632 times

Code: Select all

uses Series, TeeGDIPlus;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
    tmp: Double;
begin
  Chart1.Canvas:=TGDIPlusCanvas.Create;

  with Chart1.AddSeries(TBarSeries) as TBarSeries do
  begin
    for i:=0 to 5 do
    begin
      tmp:=random*75+25;
      Add(tmp, FormatFloat('#0.#', tmp) + ' MB');
    end;

    Marks.Style:=smsLabelPercent;
    Marks.MultiLine:=true;
  end;
end;
Could you please try the code above to see if you still reproduce the problem with it?
Otherwise, it would mean you are doing something different than me. If that's the case, please, modify the code so we can reproduce the problem here, or arrange a simple example project we can run as-is for the same.

Thanks in advance.
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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Bar series - text alignment issue in marks label

Post by marder » Fri Sep 07, 2012 12:30 pm

Dear Yeray,

It was a little bit tricky, but i found the reson for this issue.
It seems like this issue only occurs when using "gpfDefault" as value for the property "AntiAliasText" of TGDIPlusCanvas.

The modified code should look like this:

Code: Select all

uses Series, TeeGDIPlus;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
    tmp: Double;
    lCanvas: TGDIPlusCanvas;
begin
  lCanvas := TGDIPlusCanvas.Create;
  lCanvas.AntiAliasText := gpfDefault;
  Chart1.Canvas := lCanvas;

  with Chart1.AddSeries(TBarSeries) as TBarSeries do
  begin
    for i:=0 to 5 do
    begin
      tmp:=random*75+25;
      Add(tmp, FormatFloat('#0.#', tmp) + ' MB');
    end;

    Marks.Style:=smsLabelPercent;
    Marks.MultiLine:=true;
  end;
end;
Please note that this issue does not occur on all machines.
I can rerpduce this on a Windows XP machine with SP3.

Best regards.

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

Re: Bar series - text alignment issue in marks label

Post by Yeray » Fri Sep 07, 2012 3:07 pm

Hi,

I could reproduce it both in a WinXP and a Win7 machine, but slightly different. In XP it seems to happen with both gpfDefault and gpfNormal, while in Win7 it seems to only happen with gpfNormal.
I've added it to the wish list to be investigated (TV52016337).
In the meanwhile, I'd suggest you to use gpfBest or gpfClearType.
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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Bar series - text alignment issue in marks label

Post by marder » Mon Sep 10, 2012 11:16 am

Dear Yeary,

Thanks for your fast response and the suggested workaround!

gpfClearType is exactly what I was looking for and fits perfectly!
I wonder why I did not regard this option before?!

Best regards.

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

Re: Bar series - text alignment issue in marks label

Post by Yeray » Mon Sep 10, 2012 11:32 am

Hi Marder,

Great! :D
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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Bar series - text alignment issue in marks label

Post by marder » Wed May 29, 2013 12:31 pm

Dear Yeray.

I fear this issue has been reintroduced in TeeChart Pro V2013 =(

When I create a test project including only the code of your first post in this Thread I get the following result:
Image

I tested all types of AntiAliasText (gpfNormal, gpfDefault, gpfBest and gpfClearType)
It does not seem to make any difference. Seems like AntiAliasText is no longer regarded at all in V2013?!

Could you please assist?
Thanks and best regards

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Bar series - text alignment issue in marks label

Post by marder » Wed Jun 05, 2013 3:26 pm

Hi.

Do you have any suggestions for this issue with TeeChart Pro V2013?

Best regards.

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

Re: Bar series - text alignment issue in marks label

Post by Yeray » Thu Jun 06, 2013 2:25 pm

Hi,

I've incremented the ticket priority and added a couple of examples to reproduce the problem in the same ticket (TV52016337). So I hope this will work better in future releases.

The only workaround I can think right now is to modify the TextAlign:

Code: Select all

Marks.TextAlign:=taLeftJustify;
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