Page 1 of 1

Area series Draw style problem (TeeChart2019.ocx)

Posted: Thu Oct 10, 2019 8:15 am
by 16685990
TeeChart 2019 area series has a new option "Draw style" and is as default "Segments". We do not want area drawn as boxes but like it was drawn when using older TeeChart versions so we tried to change "Draw style" to "All" which at first looked like the solution we want. However we found out that if "Draw style" is set to "All" then "Treat Nulls" option is ignored.

Is this a bug or works as intended? Is there a way to get area series drawn as it was using older TeeChart versions?

Also TeeChartDefines.h seems to miss area series draw style values.

Re: Area series Draw style problem (TeeChart2019.ocx)

Posted: Fri Oct 11, 2019 11:30 am
by yeray
Hello,

I'm afraid the "All" "Style" doesn't support null points.
Have you tried to hide AreaLinesPen to avoid drawing the area "as boxes"?
By code:

Code: Select all

tChart1.Series(0).asArea.AreaPen.Hide
By editor:
2019-10-11_13-28-01.png
2019-10-11_13-28-01.png (17.24 KiB) Viewed 35023 times
If this is not what you are trying to achieve, please detail what result were you getting with previous versions.

Re: Area series Draw style problem (TeeChart2019.ocx)

Posted: Mon Oct 14, 2019 6:23 am
by 16685990
Area lines pen is not visible in those examples. I have tried to enable them and set transparency to 100% - no change, tried to set line width to zero - no change. Those lines always appear if area series transparency is not 0%. We need to set area series transparency to other than 0% (at least 20%) so that other series can be seen through it.

As I see it area lines is not a problem but segments are drawn a little overlapped and if transparency is not 0% overlapped areas become darker creating "area lines" of their own.

In older versions area series was drawn like "All" does now but did not ignore null points i.e. same as "Segments" now but without "area lines" of their own.

Re: Area series Draw style problem (TeeChart2019.ocx)

Posted: Mon Oct 14, 2019 7:39 am
by yeray
Hello,

I can't reproduce the problem here. This is what I'm getting with the code below:
area.png
area.png (22.32 KiB) Viewed 34996 times

Code: Select all

  With TChart1
    .Aspect.View3D = False
    .Legend.Visible = False

    .AddSeries scArea
    .Series(0).FillSampleValues 20
    .Series(0).SetNull 10
    .Series(0).asArea.AreaPen.Visible = False
    .Series(0).Transparency = 20
  End With
If you still find problems with it, please arrange a simple example project we can run as-is to reproduce the problem here.

Re: Area series Draw style problem (TeeChart2019.ocx)

Posted: Mon Oct 14, 2019 8:05 am
by 16685990
Try your example with "Area": Stairs like in my example and report back. You should see same behaviour. If I disable "Stairs" in our code extra vertical lines are not drawn like in your example code above.

My guess is area is drawn as polygon vs. rectangles (No Stairs vs. Stairs).

Re: Area series Draw style problem (TeeChart2019.ocx)

Posted: Tue Oct 15, 2019 12:07 pm
by yeray
Hello,

The lines aren't being drawn. However, the rectangles are being drawn so close that it looks like there was a darker line being drawn between them:
gdiplus.png
gdiplus.png (10.29 KiB) Viewed 34982 times
If you change the Canvas to use GDI instead of GDIPlus, this effect disappears:

Code: Select all

  TChart1.Aspect.GDIPlus.Active = False
gdi.png
gdi.png (6.43 KiB) Viewed 34982 times
Note the default Canvas changed a few years ago from GDI to GDIPlus.

Re: Area series Draw style problem (TeeChart2019.ocx)

Posted: Wed Oct 16, 2019 6:28 am
by 16685990
Sorry, but we do not want this effect. Other series are almost impossible to see through area series (depending on the data frequency) when those darker areas are visible.

Also we really (I mean really) do not want to change back to GDI because we just recently changed from GDI to GDI+ because of GDI+ shutdown problems and asian locale crash problems which we finally hoped to be over by switching to GDI+ rendering.

Please, provide a GDI+ solution to the problem if possible f.ex. changing "Segments" draw code to use polygons instead of rectangles. It seems to me that if drawn as polygons there is not this problem with GDI+. I would also check that there really is not a slight overlap drawing those rectangles when GDI+ rendering is enabled.

As another solution you should consider changing "All" draw style to honor "Treat Nulls" setting. Ignoring "Treat Nulls" setting does not make any sense at least to me. Whole "Draw Style" & "Treat Nulls" thing is very confusing. I get it if "Segments" means "I want boxes" (but then why I do not get boxes when using GDI?) but then I do not understand why "All" ignores "Treat Nulls".

We have a release deadline in three weeks so need a solution ASAP.

Re: Area series Draw style problem (TeeChart2019.ocx)

Posted: Thu Oct 17, 2019 7:52 am
by yeray
Hello,

We are studying what alternatives we have to move a pixel to the right so the rectangles don't overlap.
We'll also consider the option of drawing polygons instead of rectangles.

Re: Area series Draw style problem (TeeChart2019.ocx)

Posted: Mon Oct 21, 2019 1:50 pm
by yeray
Hello,

I've added this to the public tracker (#2256). We have a fix on the works.

Re: Area series Draw style problem (TeeChart2019.ocx)

Posted: Mon Dec 16, 2019 11:59 am
by yeray
Hello Tero,

Excuse me for the delay here.
I've just sent you a mail with a link to a TeeChart2019.ocx so you can test if it solves the issue for you.