Page 1 of 1

Annotation and 3D Graph.

Posted: Wed Feb 21, 2018 7:58 pm
by 15682815
Hello,

I use VS2017 and TeeChart NET v4.1.2017.10190.
I have got the following problems with 3D chart:

1. The Annotations are displayed correctly for 2D charts, but without any text for 3D charts.
Look at the pictures.
2D chart:
2D.jpg
Annotation for 2D chart
2D.jpg (44.38 KiB) Viewed 7281 times
3D chart:
3D.jpg
3D.jpg (45.73 KiB) Viewed 7281 times
2. Also you can see that the nearest point tool circle is outside the selected point (yellow).
3. If Annotation contains more than two text lines, only the first two lines are displayed (annotation AutoSize property is set to True).

Would you be so kind to provide me with the solutions of these problems.

Re: Annotation and 3D Graph.

Posted: Thu Feb 22, 2018 6:57 pm
by Christopher
Hello,
Vitali wrote: 1. The Annotations are displayed correctly for 2D charts, but without any text for 3D charts.
I have added this issue to our issue-tracker with id=1996. A workaround to this issue is to manually draw a similar annotation using the AfterDraw event, e.g.

Code: Select all

		Annotation tool;
		private void InitializeChart()
		{
			tChart1.Series.Add(typeof(Points3D)).FillSampleValues();

			tChart1.AfterDraw += TChart1_AfterDraw;
		}

		private void TChart1_AfterDraw(object sender, Graphics3D g)
		{
			string text = "This is annotation text" + Environment.NewLine + "With a Second" + Environment.NewLine + "And third line";
			float width = g.TextWidth(text) + 2f;
			float height = g.TextHeight(text);

			RectangleF rect = new RectangleF(g.ChartXCenter, g.ChartYCenter, width, height);
			g.Pen.Color = Color.Red;
			g.Brush.Color = Color.Yellow;
			g.Font.Color = Color.Violet;
			g.RectangleF(rect);
			g.TextOut(Utils.Round(rect.X), Utils.Round(rect.Y), text);
		}
Vitali wrote: 2. Also you can see that the nearest point tool circle is outside the selected point (yellow).
I have added this issue to our issue-tracker with id=1997. I'm afraid there is no workaround to this issue at the moment.
Vitali wrote: 3. If Annotation contains more than two text lines, only the first two lines are displayed (annotation AutoSize property is set to True).
This issue was reported in the ticket id=1989 and has already been fixed for the next release. A workaround to this issue in the ticket. Please note that manually drawing the annotation can be done with multi-line strings.

Apologies for any inconvenience these issues have caused.