LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

" Is it possible to display text label with each point in graph? "



Hello friends ,


                      I am  plotting a graph with point style "empty  square"  and  " scatter ".  I have many points(with different colours) in my graph. If I zoom in my graph , I would like to display a text ( 2 or 3 short  lines with different colours) ,which shows info about the  point,  in that "empty square" or in a rectangle near  by that    point("empty square")  as shown in attatched file .

     Please suggest me how I should approach ........

I tried with "PlotText " but I could display only one line text label ,that too overlapped with next text label(of next point) which is nearer to this.

Is it possible to diplay  a rectangle or square with text (in diff colour)  at   each  point  in my graph.....................?
 (this rectangle or square should not be overlapped with next one )


U can find  "  my expected graph display"   in the file( see  attatchment ).



Thank you


regards

raj

 


Message Edited by rajj on 07-14-2005 01:18 AM

0 Kudos
Message 1 of 3
(3,275 Views)

Hi rajj,

the PlotText can help you but you'll have to work a little to cover all of your needs. Look at the sample project attached.

Some hint to help you:

  • To display text in more colours, you can simply plot different texts with different colour: in my example is shown how to determine vertical position based on Y-axis settings and graph dimensions to align texts one on top of the other. GetTextDisplaySize can help you to position different plots near one to each other
  • If you use a monospaced font and a coloured background you can add some user friendliness to the messages shown without need to struggle on text lenght: simply format strings that are the same number of characters and they will show with the same lenght on the graph
  • Unfortunately the texts plotted on the graph do not update when resizing the control, so they tend to move far away when zooming on and to overlap when zooming off
  • You could use cursors to dynamically display some informations on the graph point clicked on: even in this case the texts do not adapt to resizing, but simply clicking again on the data point you can force the program to update the texts as in my example

A box can be added around the texts by using PlotRectangle: again, GetTextDisplaySize can help you in positioning the rectangle: you must transform pixel dimensions in terms of X- and Y- axis scales of the graphs.

 

As a last suggestion, please do not post the same question more times: you may be missing some answers and the discussion will be difficult to follow up in case it needs replies and / or additions and it is spread over more threads. Thanks.

Message Edited by Roberto Bozzolo on 07-14-2005 01:03 PM



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 2 of 3
(3,265 Views)
Hi  Bozzolo ,


 thanks  a lot .....


 ur  suggession helped me   much.....



  c u then



 raj

0 Kudos
Message 3 of 3
(3,240 Views)