TeeCanvas3d + Antialias drawing LineSeries dualcolor

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
JES
Newbie
Newbie
Posts: 5
Joined: Tue Feb 12, 2013 12:00 am

TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Mon Dec 16, 2013 9:36 am

Hi,

latest version on TeeChart (2013.09.131119 32bit) draws LineSeries non horizontal line parts wrong color.

sample code:

Code: Select all

  Chart1.Canvas:=TTeeCanvas3D.create;
  AntiAlias:=TAntiAliasTool.Create(Self);
  with AntiAlias do
  begin
    ParentChart:=Chart1;
    ShowInEditor:=false;
  end;
  AntiAlias.active:=true;
  ser := TLineSeries.Create(Chart1);
  ser.ColorEachPoint:=false;
  Chart1.AddSeries(ser);
  ser.Add(10, '', clTeeColor );
  ser.Add(10, '', clTeeColor );
  ser.Add(12, '', clTeeColor );
  ser.Add(1, '', clTeeColor );
  ser.Add(15, '', clTeeColor );
  ser.Add(13, '', clTeeColor );
  ser.Add(13, '', clTeeColor );
Thanks,
Janne

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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Mon Dec 16, 2013 10:29 am

Hi Janne,

I can reproduce this in 2D, not in 3D. Is this what you observed?
Lines.png
Lines.png (13.5 KiB) Viewed 20162 times
I reproduced it with v2013.09 but not any more with the actual sources, with the changes explained here:
http://bugs.teechart.net/show_bug.cgi?id=491
Lines2.png
Lines2.png (17.13 KiB) Viewed 20144 times
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

JES
Newbie
Newbie
Posts: 5
Joined: Tue Feb 12, 2013 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Mon Dec 16, 2013 12:46 pm

Hi,

yes I meant 2D (I was set it on component so I forgot it on sample code).

Good to know that it is fixed, when is next release (or can I have fixed source)?

Thanks, Janne

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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Mon Dec 16, 2013 2:45 pm

Hi Janne,

In the actual version you could already do something similar to what the next version will do: you could just use GDI+ and remove the TAntiAliasTool.

If you still find problems with it, please 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

JES
Newbie
Newbie
Posts: 5
Joined: Tue Feb 12, 2013 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Mon Dec 16, 2013 3:35 pm

Hi,

yes I know, but I don't like how GDI+ looks like.

Everything looks like you have bad vision (kind of blurry) + all lines are thick, text you can set normal and then it looks sharp but trend lines, back grid, etc. looks bad.

Janne

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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Thu Dec 19, 2013 9:56 am

Hello Janne,

We are looking at the possibilities here. Maybe we can allow to enable/disable the antialias on GDI+ for each part of the chart.
I'll be back to you asap.
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

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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Thu Dec 19, 2013 4:09 pm

Hi Janne,

Let me try to explain the alternatives you have with GDI+, then if you find any problem with any of them, or for any reason they don't fit your needs, please don't hesitate to let us know.

- With GDI+ you can activate/deactivate the AntiAlias

Code: Select all

  (Chart1.Canvas as TGDIPlusCanvas).AntiAlias:=False; 'True by default 
- Then, you can activate/deactivate the AntiAlias for a single series using the BeforeDrawValues/AfterDrawValues events of the series. Ie:

Code: Select all

procedure TForm1.SeriesBeforeDrawValues(Sender: TObject);
begin
  (Chart1.Canvas as TGDIPlusCanvas).AntiAlias:=True;
end;

procedure TForm1.SeriesAfterDrawValues(Sender: TObject);
begin
  (Chart1.Canvas as TGDIPlusCanvas).AntiAlias:=False;
end;
So, your example, simplified and with GDI+ enabling the AntiAlias for the series with the trick above looks like this:
GDI+AntiAlias.png
GDI+AntiAlias.png (13.1 KiB) Viewed 19979 times

Code: Select all

uses TeCanvas, Series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;

  with Chart1.AddSeries(TLineSeries) do
  begin
    AddArray([10,10,12,1,15,13,13]);
    BeforeDrawValues:=SeriesBeforeDrawValues;
    AfterDrawValues:=SeriesAfterDrawValues;
  end;

  (Chart1.Canvas as TGDIPlusCanvas).AntiAlias:=False;
end;

procedure TForm1.SeriesBeforeDrawValues(Sender: TObject);
begin
  (Chart1.Canvas as TGDIPlusCanvas).AntiAlias:=True;
end;

procedure TForm1.SeriesAfterDrawValues(Sender: TObject);
begin
  (Chart1.Canvas as TGDIPlusCanvas).AntiAlias:=False;
end;
- On the contrary direction, some series like the TFastLineSeries, include the FastPen property that actually disables the AntiAlias when set to true (only for the series), to improve the speed.
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

JES
Newbie
Newbie
Posts: 5
Joined: Tue Feb 12, 2013 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Wed Jan 15, 2014 3:14 pm

Hi,

thanks for you answer (I have actually option in program to user change drawing to GDI+).

But same problem stays on line drawing, when drawing horizontal parts of line it is about 2 pixel thick and when lots of points near eachother in line it looks messy.
GDI and Antialias is much better looking.

So any information when fixed code is released (or can I have fixed source code part) so that I can start using this new version?!

Janne

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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Fri Jan 17, 2014 3:27 pm

Hi Janne,

I see:
- TAntiAliasTool in v2013.08 gave an smoothed line, respecting the colors and with thin horizontal lines and grids:
v2013.08.png
v2013.08.png (28.86 KiB) Viewed 19893 times
- In v2013.09, the TAntiAliasTool gives an smoothed line, with thin horizontal lines and grids, but breaking the colors:
v2013.09.png
v2013.09.png (25.44 KiB) Viewed 19895 times
- In the actual sources. The TAntiAliasTool gives an smoothed line, respecting the colors, but with thick horizontal lines and grids:
v2014.10.png
v2014.10.png (28.71 KiB) Viewed 19896 times
I've made an example to test the different alternatives.
AntiAliasTest.zip
(1.01 MiB) Downloaded 818 times
The zip contains an exe built with the actual sources so you can test the alternatives and see if any of them fits your needs.
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

JES
Newbie
Newbie
Posts: 5
Joined: Tue Feb 12, 2013 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Mon Jan 20, 2014 1:00 pm

Hi,

thanks for testing & sample.

So is it gone be fixed (GDI with Antialiastool)?

(GDI+ (antialias only Series Option) also could be fine if straight lines drawing is not two pixels)

Do you have Bugzilla code to track progress?

Janne

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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Mon Jan 20, 2014 2:03 pm

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

JES
Newbie
Newbie
Posts: 12
Joined: Thu Feb 06, 2014 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Fri Feb 28, 2014 9:47 am

Hi,

installed TeeChart 2014.10.140220 and added global project define: TEEANTIALIAS (and recompiled).

It works and reverts to use TAntialias canvas but the dualcolor bug is not fixed on TAntiAliasCanvas!

Is it possible to get fixed version, I really need to use this old method.

Janne

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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Narcís » Fri Feb 28, 2014 11:42 am

JES wrote: the dualcolor bug is not fixed on TAntiAliasCanvas!
It works fine for me here using build 2014.10.140220 with Yeray's project. Does his project work fine for you? Otherwise, can you please modify it so that we can reproduce the problem here?

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

JES
Newbie
Newbie
Posts: 12
Joined: Thu Feb 06, 2014 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Fri Feb 28, 2014 1:54 pm

Hi,

when compiled here it does not work, which files should I check?

Janne

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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Fri Feb 28, 2014 3:31 pm

Hi Janne,

Just making sure the library path contains a reference to TeeChart v2014.10 installation lib path, and no other TeeChart path is in the library list, I open the project above, I build&run it and I get this:
2014-02-28_1626.png
2014-02-28_1626.png (22.84 KiB) Viewed 19728 times
Also, if you want to check what TeeChart version is used to build a project, you can output the TeeMsg_Version constant:

Code: Select all

uses TeeConst;
//...
  Caption:=TeeMsg_Version;
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