Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

waveformGraph axes set min and max

This is the activeX code to set plot axes min and max, but I am NOT able to find similar method to set Min and Max in C#
by using waveformGraph component.

    Private Sub ClearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButton.Click
        CWGraph1.ClearData()
        CWGraph1.Axes.Item(1).SetMinMax(0, 100)
    End Sub

C#

       private void ClearButton_Click(object sender, EventArgs e)
        {
            waveformGraph1.ClearData();
            waveformGraph1.Axes.???
        }

There is no Item property there??

Thanks
Matt
0 Kudos
Message 1 of 2
(2,873 Views)
Hi Matt,

In order to set a new max or min value for an axis for an axes object, you will need to instantiate a new Range object. For example, to set the min and max to -10 and 10, you would say:

sampleWaveformGraph.XAxes[0].Range = new Range(-10, 10);

For some reasons why this is the case, check out this post.  For additional reference when working with the Waveform Graph .NET control, check out the Key Measurement Studio Windows Forms Scatter and Waveform Graph .NET Control Features help topic in the NI Measurement Studio Help.


Best Regards,
Jonathan N.
National Instruments
Message 2 of 2
(2,869 Views)