LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set plot names on strip chart?

I am using the TCWGraph object as an ActiveX component in Borland C++Builder 6. I am trying to pop up a window with information about a plot on the MouseOver event. That is, I'd like the user to be able to put the mouse over a particular plot on the strip chart, and then display the name of the variable which the plot corresponds to. Ideally, I'd like to be able to permanently associate an id number with a plot that would remain with the plot, even if other plots were added or removed. I attempted to do this with the the Name property, but so far I have been unable to access this property. Is there another way to do this?

Any advice would be greatly appreciated.

Jon Renaut
Progeny Systems Corporation
0 Kudos
Message 1 of 2
(2,648 Views)
Hello Jon,

This functionality is not built-in to the CWGraph control for MouseMove over a plot... however, it is implemented for plot points as the PlotMouseMove event. I don't have access to a copy of Borland C++ Builder, but here's the Visual Basic syntax:

Private Sub CWGraph1_PlotMouseMove(Button As Integer, Shift As Integer, xData As Variant, YData As Variant, PlotIndex As Integer, PointIndex As Long)
Label1.Caption = CWGraph1.Plots(PlotIndex + 1).Name
End Sub

Note that I had to put the "+1" syntax into the code since the PlotIndex is zero-based and the CWGraph's Plots() collection is one-based.

Also, in Visual Basic if I wanted to write an ID number into a plot's Name property, I use the following syntax:

CWGraph1.Plots(1).Name = 12345

By
the way, you might get better response from the user community by posting CWGraph questions in the Measurement Studio discussion forum.

David Mc.
NI Applications Engineer
0 Kudos
Message 2 of 2
(2,648 Views)