Page 1 of 2

TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Mon Dec 16, 2013 9:36 am
by 16564983
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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Mon Dec 16, 2013 10:29 am
by yeray
Hi Janne,

I can reproduce this in 2D, not in 3D. Is this what you observed?
Lines.png
Lines.png (13.5 KiB) Viewed 21068 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 21050 times

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Mon Dec 16, 2013 12:46 pm
by 16564983
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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Mon Dec 16, 2013 2:45 pm
by yeray
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.

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Mon Dec 16, 2013 3:35 pm
by 16564983
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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Thu Dec 19, 2013 9:56 am
by yeray
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.

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Thu Dec 19, 2013 4:09 pm
by yeray
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 20885 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.

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Wed Jan 15, 2014 3:14 pm
by 16564983
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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Fri Jan 17, 2014 3:27 pm
by yeray
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 20799 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 20801 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 20802 times
I've made an example to test the different alternatives.
AntiAliasTest.zip
(1.01 MiB) Downloaded 927 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.

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Mon Jan 20, 2014 1:00 pm
by 16564983
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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Mon Jan 20, 2014 2:03 pm
by yeray

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Fri Feb 28, 2014 9:47 am
by 16568491
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

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Fri Feb 28, 2014 11:42 am
by narcis
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.

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Fri Feb 28, 2014 1:54 pm
by 16568491
Hi,

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

Janne

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Posted: Fri Feb 28, 2014 3:31 pm
by yeray
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 20634 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;