Page 1 of 1

Legend - Points Series Not Showing

Posted: Wed Sep 15, 2004 11:40 pm
by 8123754
I am creating a chart programatically as follows:

Dim Chart As New TChart

With Chart
.Legend.Visible = True
.Legend.Alignment = LegendAlignments.Top
.Legend.LegendStyle = LegendStyles.Series
End With

I add 3 Steema.TeeChart.Styles.Points series, of Triangle, DiagCross, and DownTriangle.

My legend shows the text for all 3 series, but only the DiagCross image is shown in the legend. The space where the Triangle and DownTriangle should be is blank.

All 3 series show up fine on the chart. What am I doing wrong?

FYI I am using the latest version (v1.1.1675.27998)

Hmmm...

Posted: Wed Sep 15, 2004 11:45 pm
by 8123754
A correction, which only makes this worse.

If I use top alignment for the legend, NONE of the images for the series show.

If I use the default right alignment, only the DiagCross shows.

Seems like a bug to me...?

Posted: Thu Sep 16, 2004 8:12 am
by Pep
Hi Patrick,

yes, there's a known bug. The problem is that the symbols are painted on other place around the Chart panel. We'll try to fix this bug for the next maintenance releases.

workaround

Posted: Thu Sep 16, 2004 11:40 am
by 8123754
Pep wrote:Hi Patrick,

yes, there's a known bug. The problem is that the symbols are painted on other place around the Chart panel. We'll try to fix this bug for the next maintenance releases.
Is there any workarounds? My customers have been requesting the additon of a legend to my charts, and with this bug I am unable to fufill this request.

Posted: Thu Sep 16, 2004 3:21 pm
by Marjan
Hi, Patrick.

I was able to replicate the problem here. But it only occurs when cross, diagonal cross or start pointer styles are used.

The bug is located in the Custom.cs unit, the DrawCross, DrawDiagonalCross methods. The actual drawing code in these methods assumes chart is always in 3d -> for 2d charts you'll end up with pointers shown at wrong place. I've just fixed the problem - the fix will be included in next maintenance release. In the meantime, the only workarounds I can think of is:

1) If you have TC .NET sources, change the DrawCross and DrawDiagonalCross implementations (I can send you updated unit).
2) Don't use the above three pointer styles.
3) Manually draw pointers directly on legend (I think there is an example of something similar in TeeChart demo - the custom drawing on legend example).