ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Line-To-Top waveform graph

Solved!
Go to solution

I have a waveform plot that has a Y-Axis range from 0 to 127.  It is important that the plot goes from 0 to 127.  The problem is normally the device I am measuring returns 127 for most conditions.  I am currently using a Line-To-Base style plot but would like the lines to go from the top of the chart down.  Unfortunately there is no apparent way to get a Line-To-Top style.

 

I attached my plot.  As you can see I would like the lines to go from the top down.

 

Here is my code for setting up the style of the waveformPlot (linemode is true):

                waveformPlot4.FillBase = XYPlotFillBase.YValue;
                waveformPlot4.ToolTipsEnabled = true;
                waveformPlot4.DefaultStart = lowerLimit;
                waveformPlot4.DefaultIncrement = spacing;
                waveformPlot4.YAxis = axis3;

 

                waveformPlot4.PointStyle = PointStyle.Cross;
                waveformPlot4.PointColor = Color.Yellow;

                if (!lineMode)
                {
                    waveformPlot4.FillMode = PlotFillMode.None;
                    waveformPlot4.LineColor = Color.Yellow;
                }
                else
                {
                    waveformPlot4.FillMode = PlotFillMode.Lines;
                    waveformPlot4.LineColor = Color.Empty;
                    waveformPlot4.LineToBaseWidth = 1;
                    waveformPlot4.LineToBaseColor = Color.Yellow;
                }

0 Kudos
Message 1 of 3
(4,140 Views)
Solution
Accepted by UmmGooD

Hello - 

 

You're almost there - just missing one line.  This should do it for you:

 

 

waveformPlot4.BaseYValue = 127;

 

 

NickB

National Instruments  

Message 2 of 3
(4,133 Views)
Thanks that worked great!  I can't believe I missed that.  I was assuming I would have to do some AfterDrawPlot painting or something that would be a pain.
0 Kudos
Message 3 of 3
(4,116 Views)