Page 1 of 1

Display issue of Annotation in TeeChart 2010

Posted: Fri Aug 20, 2010 3:30 am
by 15655558
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?

Re: Display issue of Annotation in TeeChart 2010

Posted: Fri Aug 20, 2010 9:17 am
by 10050769
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,

Re: Display issue of Annotation in TeeChart 2010

Posted: Thu Dec 16, 2010 2:54 pm
by 16054484
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

Re: Display issue of Annotation in TeeChart 2010

Posted: Fri Dec 17, 2010 8:42 am
by 10050769
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,

Re: Display issue of Annotation in TeeChart 2010

Posted: Fri Dec 17, 2010 3:23 pm
by narcis
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!