LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

related to display on graph control

Hi ,
In an application I am displaying some string on a graph control .Now problem is that I want to display "LABWINDOWS/CVI" (Say) on graph and due to interference it is hidding data (i.e background display-data is blocked by front data string) . How to solve this display problem ?
Regards
Subrata
0 Kudos
Message 1 of 5
(3,210 Views)

First of all, you can plot your text without its own background color choosing the appropriate value in the corresponding parameter in PlotText.

If on the contrary you want your text to absolutely not overlap your plots, you must set an appropriate value for y and y coordinates in PlotText function. You can use GetTextDisplaySize function to determine height and width of the string you need to plot, so you can adjust its coordinates not to overlap your data



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(3,203 Views)
Not sure if this is what Roberto was talking about, but if not:

You can set the background color of the text control to be transparent. You can do this in the UIR on the text control by opening up the "Paint Tool" and selecting the "T" in the 256-color popup. The other is to set it programmatically using SetCtrlAttribute for backroupd color and choosing VAL_TRANSPARENT.

You might want to choose a text color that stands out when compared to your graph background (such as, for example, yellow text on blue graph).

JB
--
To whom it may concern: My alias is also my nickname, I've had it since I was a (very) skinny basketball-playing teen. OK, so I've got a 38 inch waist now, but my hometown friends haven't shaken that appellation for me. I trust that you will someday be OK with that alias, as I have been with that nickname.
0 Kudos
Message 3 of 5
(3,200 Views)

Hi using colornumeric and then opening "paint tool" selecting " T " you told the colornumeric will be transparent over the background color of Graph control but infact it is not transparent . The background color of graph control is covered (blocked) by the foregroundground color of the colornumeric .Plz JB  reply me soon ?

 

Regards

Subrata

0 Kudos
Message 4 of 5
(3,183 Views)
I don't understand why you are struggliing with color numeric, unless is for a different reason from the original question of this thread.
 
To resume, you have two options to display text on a graph control:
  • Use a standard text control and place it on top of the graph
  • Use PlotText function on the graph control

In the first case you can simply paint the background color on the text control in transparent in the UIR editor (see the UIR attached as an example). In the second case you can use PlotText (panelHandle, PANEL_GRAPH, x, y, "Some Text", VAL_APP_META_FONT, VAL_RED, VAL_TRANSPARENT); (the text in red is the background color used to plot text).

In both cases if you want to avoid ovelapping of text and plots you must know height and width of either the plotted text (and you can use GetTextDisplaySize function) or of the text message control (with standard GetCtrlAttribute and ATTR_HEIGHT and ATTR_WIDTH option). Next you will need to calculate text position according to its dimensions and existing plots on the graph.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 5
(3,177 Views)