LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to programmatically create a graph in cvi

I can't find out how to create an XY graph programmatically (sp) in cvi 8.1.  are there any examples?
0 Kudos
Message 1 of 4
(3,389 Views)
A graph, like all other UI controls, can be created with NewCtrl or DuplicateCtrl functions: the latter to be used when another control already exists that an be used as a source to copy the new control from. in case of a simple graph the command to create it from scratch is:
   controlID = NewCtrl (panelHandle, CTRL_GRAPH_LS, "New Graph", top, left);
you will need them to customize the graph according to your need with a set of SetCtrlAttribute and some additional command to customize axes and so on.
 
To have an example of all this, I suggest you to use the UI to code converter tool: create a UIR file that has only one panel with a graph, interactively customize the graph as you want, save the UIR file and pass it to the tool found in Tools menu: the tool will create .c and .h files with all the instructions needed to create the panel and the graph from scratch.


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 4
(3,381 Views)

that's interesting.... I didn't know about the code converter

thanks

0 Kudos
Message 3 of 4
(3,378 Views)

You're welcome!

Maybe the UI to code converter worth a mention in the CVI Tips/tricks thread...



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 4 of 4
(3,363 Views)