Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

find the distance between two major axis in scatter graph

Solved!
Go to solution

Hello,

 

I have a scatter graph. Its Y-axis AutoScale property is set to false. Major and minor axis are default. Interval is default.

 

When I plot the graph the divisions displayed on the Y-axis are set accoding to the range supplied. Sometimes the interval between major divisions is exactly what is set in the Interval property and sometimes it is not the same. As it is mentioned in the help that the AutoScale property is set to true sometimes by itself in order to avoid the labels congested.

 

What I need to find is the distance beween the two major axis of the Y-axis, As the interval is not the same as set in the property.

 

Kindly let me know how to calculate the interval.

 

Regards,

Naureen.

0 Kudos
Message 1 of 9
(6,061 Views)

Hi Naureen,

 

Is this a Windows Forms or WPF application? If I'm understanding correctly, you want to find the distance between any two major divisions that you specify? Did you need to do this programmatically? If not, the value of each division is labeled and the distance can be found by finding the difference. 

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(6,039 Views)

Hello,

 

Its a Windows Forms Application and I want to find the distance between two major divisions programmatically.

 

According to my understanding the interval property should give me the distance.

But as it gets adjusted at the runtime so the interval property gives the value that

was set at design time but not the actual value which is adjusted at runtime,

even if the AutoScale property is set to False.

 

I hope you get my point.

 

Thankyou,

Naureen.

 

0 Kudos
Message 3 of 9
(6,030 Views)

I tried setting up a Scatter graph with Autospacing set to false and the plotted graph seems to have the major divisions at the intervals I set for MajorDivisions.Interval. What does it look like for you when you graph the data?

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 9
(6,020 Views)

Hi,

 

You must be plotting lesser values, lets say 1-10 range on Y-axis, but when you will plot larger range values say 1-1000 or more you will be able to see that the plotted graph does not have the major divisions at the intervals you set for MajorDivisions.Interval.

 

I have mentioned this in my very first post as well.

 

I hope you will be able to observe this behaviour, otherwise please send me your sample code.

 

Thankyou,

Naureen.

 

 

0 Kudos
Message 5 of 9
(6,012 Views)

So it sounds like for your data range, the graph is behaving as if AutoSpacing is true. Do you need AutoSpacing to be false? If not, you can obtain the major division intervals with <yaxis>.AutoSpacingMajorInterval when AutoSpacing is true.

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 9
(5,992 Views)

Hello,

 

I am unable to find AutoSpacingMajorInterval property.

 

Please can you send me the sample code.

 

Regards,

Naureen.

0 Kudos
Message 7 of 9
(5,982 Views)
Solution
Accepted by Naureen

yAxis1.AutoSpacingMajorInterval

Replace yAxis1 with whatever your y-axis for the scatter graph is called. If you're not sure what it is, right click on the y-axis of the scatter graph and select Edit YAxes. Then a box will come up and you can see what it is called in the members section.

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 9
(5,953 Views)

Hello,

 

Thanks alot, its working.

 

Regards,

Naureen.

0 Kudos
Message 9 of 9
(5,914 Views)