From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

travelling Chart bug?

Dear all,

i want to programmatically control position of the chart and its legend via property nodes.

but instead of moving to the indicated position the chart keeps moving with ervery loop iteration by the amount specified in the control.

is that intended behaviour??? or do i have to fix some origin on the FP?

Thanks!

best,

OPCer

 

 

0 Kudos
Message 1 of 10
(3,553 Views)

Hi,

 

Is this what you were trying to accomplish, or have I misunderstood? I just put everything in different events.

 

-RautSa

0 Kudos
Message 2 of 10
(3,532 Views)

This is actually really interesting behavior! I looked at it and at first I was also confused about why the chart would be traveling from iteration to iteration, since you are just putting a contant value into the position. But I think it is actually the intended behavior. If you look at it more carefully, here is what is actually going on:


Step 2.pngStep 3.pngStep 4.png

 

Basically, the thing to note is that moving the graph with the position property also moves the legend, and that is causing some weird behavior in this case because you are also moving the legend itself.

 

--Hope

0 Kudos
Message 3 of 10
(3,525 Views)

@RautSa

youor solution is no "fix", i can get the following, entering 0/0/0/0 after entering some other values:

positioning.PNG

 

 

@prettypwine
ah, i also thought about there must be some interaction and resetting the origing position of both coordinate systems that is hidden from the user. you description fits to the fact that if i remove any one of the property nodes from the BD the other functions fine. but this does not convince me to be "intended behaviour"?? you yourself state it is "weird"? is it possible to relate these position numbers to som absolute FP origin?

0 Kudos
Message 4 of 10
(3,514 Views)

Yes, the positions for both of those properties refer to absolute coordinates relative to the origin.

Here is where the origin is on your VI:

origin.png

The "left" parameter is basically specifying how many pixels to the right of the origin to place the graph, and the "top" parameter specifies how many pixels down from the origin to place the graph. I think each grid square is 12 pixels.

0 Kudos
Message 5 of 10
(3,505 Views)

I guess maybe something that's confusing you is that the origin is not always at the top left of the visible front panel (the front panel will let you scroll to negative coordinates).

 

If you want to force the origin to be at the top left, you can do that yourself using VI property nodes, or there is actually already a VI that will do it for you. Just go to VI Package Manager and download the MGI Application Control package (it is free) and use the VI called MGI Origin At Top Left.

0 Kudos
Message 6 of 10
(3,502 Views)

well the origing that the chart position refers to obviously changes every iteration of the loop. this is quite non-intuitive. even if i wire (0,0) to a Pane origin property node the graph keeps moving 😞

0 Kudos
Message 7 of 10
(3,489 Views)

No, the origin does not change every iteration of the loop. If you read the documentation for the position property, you can see that it says it sets "the position of the top left corner of the bounding rectangle of the object". That means that it sets the position of the entire graph, including the legend. But then you move the legend by itself back further. This means that over time the graph and legend get further apart from each other. That's why it looks like the graph is moving, not because you're not setting absolute position. I think my pictures above explain this really well, if you look at them again more carefully.

 

Try turning on highlight execution and watching what happens, that should slow it down enough to illustrate what's going on for you.

 

I totally agree though that this is very unintuitive!

Message 8 of 10
(3,482 Views)

Hi,

 

It seems you have discovered some rather interesting behaviour, we are looking into this, I will keep you updated!

 

-Michael

0 Kudos
Message 9 of 10
(3,481 Views)

Fashinating behaviour indeed. And here I assumed that "Position" means only charts position and failed to realize it also includes legends position. prettypwine explained the behaviour quite nicely. Some simple math should do the trick, if you want to move the components independently.

 

-RautSa

0 Kudos
Message 10 of 10
(3,447 Views)