Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

line segments in CWgraph

Is it possible to draw multiple disconnected line segments as a single plot
in CWgraph or do I need to
implement these as separate plots. (if so, how many plots can I put on a
graph??)

Thanks
SteveS
0 Kudos
Message 1 of 6
(4,261 Views)
If they are discrete line segments (have specific endpoints), then yes, you would need multiple plots. There are line styles for dashed lines, but I don't think this it what you are wanting.

Best Regards,

Chris Matthews
Measurement Studio Support Manager
0 Kudos
Message 2 of 6
(4,261 Views)
I'm not sure exactly what you mean by disconnected line segments but I will give you a few suggestions based on what I think you mean.

If you want to draw a bar chart, yes you can simulate this with one array of data and a single plot. To do this you can go to the Property pages of the CWGraph and select the Plots tab, from here change the line style drop down menu to XY Step and check the Fill to base and Lines checkboxes. Tada! you can see the style of your graph now resembles a bar chart. Now I know that the bars are all right up against one another, but if you want to get around this you can set the index that you would like a separation at to 0 so that basically that line is drawn at the origin. The other drawback is that if you want separate colors you will
absolutely have to have separate plots one for each color, and I'm sure you can understand what to do here from what I've already said.

Now the other thing I thought you might have meant was to just simply draw multiple irrelevant lines on one graph and the answer to this is yes as well. Just go to the Property pages for the graph and select the PLots tab and click the 'add' button to add more, they will all have their own settings for style and you can also associate them with different axes under the Axes tab.

Other than that you will have to specify more exactly what it is you are looking for and if you aren't quite sure you can do quite a bit of research yourself by studying the ComponentWorks online help, the ComponentWorks examples in your Measurement Studio\VB\Samples directory, and by opening up the Object Browser in VB and looking at all of the properties and methods exposed by the CWGraph object for programmatic manipulation of the control.

Jason F.
Applications Engineer

National Instruments
www.ni.com/ask
0 Kudos
Message 3 of 6
(4,261 Views)
You can get multiple line segments out of one plot by inserting NANs into the data to break up lines.

data(1) = line1start
data(2) = line1end
data(3) = NAN64
data(4) = line2start
data(5) = line2end
Message 4 of 6
(4,261 Views)
Aaron,
Thank you so much for your suggestion. It worked like a charm.
Now I have to add this feature to a VC++ program (ugh).
Do you know how I would create a NAN64 variable in VC++??
Thanks again for the great suggestion, it saved mucho problems in an
implementation!!
--Steve

"Aaron" wrote in message
news:50650000000500000094310000-991728092000@quiq.com...
> You can get multiple line segments out of one plot by inserting NANs
> into the data to break up lines.
>
> data(1) = line1start
> data(2) = line1end
> data(3) = NAN64
> data(4) = line2start
> data(5) = line2end
0 Kudos
Message 6 of 6
(4,261 Views)
Just try this code u may get a solution

CWGraph1.Plots(CWGraph1.Plots.count).LineStyle = cwLineDash
CWGraph1.Plots(CWGraph1.Plots.count).LineStyle = cwLineDashDot
CWGraph1.Plots(CWGraph1.Plots.count).LineStyle = cwLineDashDotDot
0 Kudos
Message 5 of 6
(4,261 Views)