Display issue of Annotation in TeeChart 2010

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
mcpang
Newbie
Newbie
Posts: 15
Joined: Wed Mar 31, 2010 12:00 am

Display issue of Annotation in TeeChart 2010

Post by mcpang » Fri Aug 20, 2010 3:30 am

I am using Steema.TeeChart.Tools.Annotation and I property "Top" and "Left" to position the textbox. It works fine in TeeChart v2009 but in TeeChart 2010, the textbox is always at 0,0(top left corner) even i have set its "Top" and "Left" to something else. Below is the code that i am using:

Annotation marker = new Steema.TeeChart.Tools.Annotation(displayControl.Chart);
marker.Top = 10;
marker.Left = 30;

In TeeChart v2009, when I set marker.Top and marker.Left, marker.Bounds.Left and marker.Bounds.Top is reflected to the values set and it displays correctly.
In TeeChart v2010, when i set marker.Top and marker.Left, marker.Bounds.Left and marker.Bounds.Top still remain as 0 and it displays at the top left corner.

Can you please advise regarding to the above mentioned issue?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Display issue of Annotation in TeeChart 2010

Post by Sandra » Fri Aug 20, 2010 9:17 am

Hello mcpang,


You need refresh Chart if you want your application works fine. You can do a similar code as next :

Code: Select all

private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            line = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line.FillSampleValues();
            Steema.TeeChart.Tools.Annotation annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
            annotation1.Text = line.Title + ":" + " " + line.XValues.Maximum.ToString();
            tChart1.Draw();
            annotation1.Shape.CustomPosition = true;
            annotation1.Shape.Left = 10;
            annotation1.Shape.Top = 30;
        }
I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Aaron_Peronto
Newbie
Newbie
Posts: 8
Joined: Wed Oct 21, 2009 12:00 am
Contact:

Re: Display issue of Annotation in TeeChart 2010

Post by Aaron_Peronto » Thu Dec 16, 2010 2:54 pm

I am haivng a problem with this as well.
I use annotations to label my custom veritcal axes with the axis name (Y1, Y2, Y3, etc) slighty above the top end of the axis.
Previously, I was adding the annotations and moving them to their proper position in the BeforeDrawSeries event handler to make sure that I am only drawing the labels for the axes that are actually visible.

Since we deal with very large graphs (20+ Million points), we perform a manual "double buffering" by using a bitmap of the graph itself as the item displayed. We perform a DrawToBitmap in order to render the graph to the bitmap that we then disaply.
I thought that I could place my Annotation movement code in the AfterDraw event handler. However, this gets fired AFTER I draw to my bitmap. I am then moving the annotations on the graph but that movement is NOT reflected in the bitmap that I have drawn unless I draw it again. Which is a huge performance hit. That would mean I would have to draw the graph twice each time I wanted to render it. I don't see how that is going to be acceptable to our users. We have high draw times already simply because of the number of points we place on some of our graphs.

Can you explain to me why this placement of the annotations was changed?
I used to have no problem placing and moving these annotations prior to drawing the chart. Now it appears that I am going to have to remove these labels on the axes which have been there for the past 4 years of production use of our application. I hope this is not the case. If you can think of any other way I could place these annotations properly each time my graph draws and move them without having to draw the graph twice to ensure that they appear properly in the bitmap, please let me know.

Thanks for the information.
Aaron Peronto
Siemens

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Display issue of Annotation in TeeChart 2010

Post by Sandra » Fri Dec 17, 2010 8:42 am

Hello Aaron_Peronto,

Thank you for information, but I couldn't reproduce your problem here with last version of TeeChart.Net. Could you please, send us a simple project because we can reproduce your problem exactly here?


Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Display issue of Annotation in TeeChart 2010

Post by Narcís » Fri Dec 17, 2010 3:23 pm

Hi Aaron,

For completeness, if you are doing real-time charting applications we think it can be very helpful for you checking out TeeChart.Direct2D.dll which has released recently. More information may be found here.

Have a nice weekend!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply