LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tracking a graph's scrollbar

I've looked through the properties and the help for this one...

I'm just wondering if there's a way to programmatically get the position of the x-scrollbar on a graph, in order to set a string indicator.

For example, say a unit needs to do the same test, but in both directions (CW, CCW).  I have kept a continuous plot, which extends over the plotting area of the graph, thus providing a use for the scrollbar.  I'm just wondering if there's a way to know where that scrollbar is, in order to tell the user that they are looking at CW, or CCW data.  So when the scrollbar reaches a certain point, the direction changes.

I have done this a different way before, plotting one direction of the graph, storing that history, and then plotting the other direction on the same graph, storing that history, and then have the user select from a listbox which direction they want to see, but if I could get the scrollbar position, this would be far easier.

Thanks for any suggestions/help.
0 Kudos
Message 1 of 7
(3,288 Views)
XScale.Range.Start should do it.
 
Regards,
Ryan K.
Message 2 of 7
(3,280 Views)
Thanks, that's exactly what I was looking for...apparently I didn't look hard enough in the properties...

I have a follow-up question to that...  I've been able to determine that the value is more or less a percentage of the plot area, starting at 0, and 100 is the edge of the plot window when the scrollbar is all the way to the left.

I can't however, figure out how to make that more precise.  What's happening is, while I'm scrolling, I only see the X Scale.Range:Start in increments of 20.  I've been fiddling around with some other things, but can't seem to have much success.  I apologize for what turned out to be a stupid question, as I'm sure this one is too...

Thanks a lot though
0 Kudos
Message 3 of 7
(3,276 Views)
And, if I were to use an event to handle when a user wishes to move the scrollbar, would the "coords" element from the event data node return the coordinates of where the mouse is in the control?  Or just where the mouse is on the front panel, with the reference being the (0,0) on the block diagram?

Or would there be a better way to handle this...  thanks
0 Kudos
Message 4 of 7
(3,265 Views)
Sorry, my fault, Range.Minimum is probably a better choice.  The Range.start has to be an actual point on the scale, so it's resolution is limited to the Range.Increment.  It shouldn't be a percentage though, you may just happen to have a plot with 100 points.  Range.minimum should display the actual left value of the visible window (and Range.maximum would display the right value)
0 Kudos
Message 5 of 7
(3,263 Views)

To my knowledge, there isn't an event generated other than mouse move when you are scrolling.

The coords event data for mouse events is generally in relation to the Front Panel Origin.  You can translate that into screen coordinates (http://digital.ni.com/public.nsf/websearch/084B09DCABB66FD586256E21004F6458?OpenDocument) but you'd have to do some calculations to figure out whether the mouse is in the scrollbar and where it is.  The scale properties are probably a better bet.

 

Regards,

Ryan K.

0 Kudos
Message 6 of 7
(3,260 Views)
Yeah, you're right about the range.minimum...that was exactly what I was looking for.  As for the range.start...  I had set both the x Scale.Increment and X Scale.MinorIncrement to 1, and tried with different values for both, but couldn't get the X Scale.start to go by intervals anything but 20...  probably the way I had the graphing going.  Either way, problem solved, and thanks a lot for the help!
0 Kudos
Message 7 of 7
(3,258 Views)