Annotation and 3D Graph.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Vitali
Newbie
Newbie
Posts: 1
Joined: Mon Jan 15, 2018 12:00 am

Annotation and 3D Graph.

Post by Vitali » Wed Feb 21, 2018 7:58 pm

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 7302 times
3D chart:
3D.jpg
3D.jpg (45.73 KiB) Viewed 7302 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.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Annotation and 3D Graph.

Post by Christopher » Thu Feb 22, 2018 6:57 pm

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.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply