LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Annotations Overlapping

Solved!
Go to solution

What I am doing:

I have LabVIEW 2011. I am creating multiple random number generated XY plots.

I am creating annotations to show the furthest point in each plot.

What is happening:

When the last points in each plot are close, the names and arrows overlap.

I want to be able to fix this.

 

I was thinking of keeping a collection of Y positions of each annotation that is created and ordering them relative to the average of each plot.

Anyone think of a better idea?

CLD Certified 2014
0 Kudos
Message 1 of 8
(4,343 Views)

Hi ADrexel,

 

Are you able to upload the code to this forum?

 

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 2 of 8
(4,320 Views)

Yes but I do not have LabVIEW on this computer. Here is the file I work with. I am not sure the current status of the code. I last worked on it 2 weeks ago. I have tried different ideas but nothing would be considered a good solution.

I wish I could view the code with like a LabVIEW Block Diagram Viewer... but that does not exist.

I hope you have LV2011

CLD Certified 2014
0 Kudos
Message 3 of 8
(4,318 Views)

Hi ADrexelDragon,

 

I was looking at your VI and I have two ideas that I would think will work for you, the first is that instead of collecting all the Y positions, and this is a for loop with a finite iterations number, you just need to compare the last Y value and if the difference between Y1 and Y2 is less than the minimum, change a little bit the plotting coordinate for the names. The second option that you can consider is to place the plot names out of the graph, with the name and the reference color for the plot.

 

I hope this will help you.

 

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 4 of 8
(4,298 Views)

Thanks for the response.

I have thought about assigning names to the legend.

If I don't do that, the first option sounds doable. Is there a way to have a box outlined the name of the plot? Or maybe make the text bold?

Thanks,

Nick

CLD Certified 2014
0 Kudos
Message 5 of 8
(4,292 Views)
Solution
Accepted by topic author ADrexelDragon

Interesting questions. The answer depends on what you really want to achieve. For instance, if the number of plots is larger than H/h, where H is the height of your graph (the black area) in pixel and h is the height of an annotation string, then whatever solution you find to position your annotations, they will overlap unless you stagger them horizontally as well...

Assuming that you will never be in this situation, you could find the min Y and max Y of your graph Display and follow either of these two conventions:

 

1) list the annotations from Graph1 to Graph N, giving annotation n (= 0, ..., N-1) a Label Offset.Y = max Y - (n+1) (max Y - min Y)/(N+1) - last Y

(this can be messy).

 

2) list the annotations from largest final Y to smallest final Y.

 

Check out the attached modified code.

Message 6 of 8
(4,284 Views)

I like your example. I would definitely use the "Last Coordinate Order" rather than the plot order. Thank you.

I added a feature to change the color of the name based on the plot. See attached.

 

Also, I am still wondering if it is possible to add a box around the name. I think that would be something really cool to add onto the graph. Also, if the box had background color capabilities that would overlay the graph.

CLD Certified 2014
0 Kudos
Message 7 of 8
(4,280 Views)

These properties are not accessible, unfortunately.

If you have suggestions for Annotations, post them in the NI LabVIEW Idea Exchange Forum (link back to your original post if you don't want to rewrite everything).

I have my own qualms  with annotations... And the graph objects have received their fair share of complaints too...

0 Kudos
Message 8 of 8
(4,262 Views)