Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Alignment of y axis label changes with range

Hello

I have a waveform graph where the user can change the y axis range.

If the range becomes smaller than 1, then the aligment of the axis major division labels changes, making the area for the graph smaller (see attachments).

I'm using Winforms and VisualStudio 2010.

 

Many Thanks

hans

Download All
0 Kudos
Message 1 of 6
(6,346 Views)

You can set the MinimumWidth property of the YAxis to a value large enough to provide space for all possible range precisions.

National Instruments
0 Kudos
Message 2 of 6
(6,331 Views)

I tried MinimumWidth but it does not seem to have an effect. If you look at the two screenshots, which I attached to the first post,  you can see that there is enough space for the labels.

Also, if the I have a spacing of 0.101, then it's ok.

If the spacing is 0.1, then it's not (see attachments).

Somehow, the alignment of the numbers seems to change but I don't understand it and also don't know how I could influence that.

 

Download All
0 Kudos
Message 3 of 6
(6,325 Views)

I can't figure out how that is happening in your screenshot. I have not seen that behavior before and cannot reproduce it in any way. Do you have an example project you could send me? This is certainly not expected behavior. Attached are screenshots of what I was able to do just by setting the MinimumWidth property.

 

 

National Instruments
Download All
0 Kudos
Message 4 of 6
(6,307 Views)

Hi

I have found out what is happening but not why. The problem was that I constructed the range object with floats instead of doubles. This leads to different behaviour. Why, I don't know. I attached a sample project that shows the difference for float and double. Also, as you said, by choosing MinimumWidth big enough, the size of the graph will stay constant. For double, required minimum width is 50 and for float 75. This works but wastes quite a lot of space.

 

This is good enough for me, thanks for the discussion.

hans

 

Download All
Message 5 of 6
(6,289 Views)

That explains why I did not see the issue, I was using double for the data type. Also, it appears that this issue is fixed in Measurement Studio 2012. It does not seem that this issue was ever reported, but a couple similar issues where scales were the incorrect size were fixed in 2012, so I suspect that this was related to one of those issues. I will confirm this to ensure that it is fixed. But it seems that you will not see this behavior with floats if you upgrade to MStudio 2012.

 

Thanks for the help troubleshooting this.

National Instruments
0 Kudos
Message 6 of 6
(6,277 Views)