08-11-2016 05:15 AM
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
08-11-2016 05:28 AM
Hi,
Is this what you were trying to accomplish, or have I misunderstood? I just put everything in different events.
-RautSa
08-11-2016 05:40 AM
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:
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
08-11-2016 05:51 AM
@RautSa
youor solution is no "fix", i can get the following, entering 0/0/0/0 after entering some other values:
@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?
08-11-2016 06:05 AM
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:
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.
08-11-2016 06:12 AM
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.
08-11-2016 06:48 AM
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 😞
08-11-2016 07:02 AM - edited 08-11-2016 07:05 AM
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!
08-11-2016 07:02 AM
Hi,
It seems you have discovered some rather interesting behaviour, we are looking into this, I will keep you updated!
-Michael
08-11-2016 11:23 PM
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