Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with annotations

Hello,
I am using the Measurement Studio and I have got a problem with annotations in a waveformgraph control. I want to add between 0 and 1000 annotations in a graph to mark the position. However when i add the annotations to the graph it takes a very long time. Am i doing anything wrong?
 

Dim anSpotAnnotation(iNumberOfDamages-1) As NationalInstruments.UI.XYPointAnnotation

for  iIndex=0 to iNumberOfDamages-1

anSpotAnnotation(iIndex) =

New NationalInstruments.UI.XYPointAnnotation

anSpotAnnotation(iIndex).XPosition =.........

next

wfGraph.Annotations.AddRange(anSpotAnnotation)     ' !!! very very slow

0 Kudos
Message 1 of 5
(4,041 Views)

Hello,


You don’t make anything wrong… Your programm take the best way to do that…


But 1000 annotations, that’s big and that took time.


Best Regards


Matthieu Papaux
Application Engineer
NI Germany

0 Kudos
Message 2 of 5
(4,017 Views)
Hi

Can you clarify why you are adding upto a 1000 annotations? Are you trying to highlight a range of data or a 1000 individual points? For a range of data, it would be best to use a range annotation instead of a 1000 point annotations.

Bilal Durrani
NI
0 Kudos
Message 3 of 5
(4,004 Views)
First of all, thanks for the replies.
 
I need 64 plots in one graph and wanna show up to 1000 really individual points. The plots are measurement data in which i wanna show some analysed points. Would there be another possibility to mark individual points in a graph, or individual points in the plot.
If i only show a small part of the data, all the graph operations are getting very slow as well...for example zooming.
0 Kudos
Message 4 of 5
(3,999 Views)

Hello

We are looking into optimizing the annotations further in future releases.

However, for now, you might be better off drawing the annotation yourself using gdi+. I have attached an example of this.

I use the AfterPlotDraw even, get the graphics object of the plotarea and draw shapes around the points I'm interested in. You will notice that the point size remains the same even after zooming. You can easily add something to track the pointsizes if that is important for you.

But you will notice this implementation is significantly faster. It doesnt have captions or arrows that you can interact with. But it marks the interesting data.

Hope this helps


Bilal Durrani
NI
0 Kudos
Message 5 of 5
(3,989 Views)