Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Annotations.Add very slow Visual C++

I need to add lots of annotations on my graph. The problem is the time for adding all the annotatios is too big. From what i have observed the time for a
for ( i = 0 ; i < MAX_COUNT ; i++ ) niGraph.Annotations.Add ( )
depends on MAX_COUNT ^ 2. Is there any workaround to the problem? I really need the annotations.

Thank you,
Mircea
0 Kudos
Message 1 of 4
(3,323 Views)
Hello

I guess I dont really know how many annotations you are planning to add, but you might want to consider adding them during design time. Adding several hundred annotations programatically will take a little time, since you are creating annotation objects on the fly and adding them to the graph.

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 4
(3,323 Views)
Hello

I have to add a maximum of 2000 annotations and unfortunately i can't add them staticaly. And adding them dynamically takes just too long ( a few minutes ) I was thinking about drawing them but i don't know how to draw on the same plot lines that are not connected like 1 1 for example. Please tell me how can I do that ( if I can ) If I draw everything on a new plot than I have the same problem ( i would add 2000 plots not 2000 annotations ).

PS I was wondering why adding an annotation is dependent on the annotation number. Are all the other annotations redrawn ?

Thank you for your time
Mircea Mateica
0 Kudos
Message 3 of 4
(3,323 Views)
An annotation is not just a drawing on the graph, everytime you add an annotation, you are actaully creating a CWAnnotation object, each with its own methods and properties. Having 2000 plots probably wont change things either, since you will have created 2000 CWPlot objects.

Bilal
Bilal Durrani
NI
0 Kudos
Message 4 of 4
(3,323 Views)