01-26-2018 12:52 AM
I need to have a waveform graph or chart show a fixed grid, at least on the X scale.
This is accomplished by setting the "Increment" and "MinorInc" properties of the respective graph/chart and is working fine...
...unless you change the Min/Max values of the Y scale, which changes both the X scales' "Increment" and "MinorInc" properties. Is this the intended behaviour? I'm listening for Scale Range Change and Autoscale Range Change events, but nothing is fired for the X scale.
To reproduce, just start the attached VI and follow these steps:
1) Set the Y scale max to 1
2) Press the "Set X-grid"-button
3) Set the Y scale max to 8
Solved! Go to Solution.
01-26-2018 01:36 AM
One of the problem is that you use an x-axis style that does not even have markers, and the formatting of the markers is set to show zero decimal digits.
Once you set it to a scale style with actual tick marks, enlarge the graph in the x-direction so the desired ticks can even be displayed, and set the x-scale formatting to show at least 1 decimal digit, things work just fine, it seems.
01-26-2018 02:04 AM
This has to be a bug.
Your version is indeed working, even if the graph is resized to the small size again (WaveformGraph_resized.vi).
If I configure my graph to the same X scale style and X scale formatting, it still doesn't work - despite the graph having the same size (WaveformGraph_original.vi).
01-26-2018 10:30 AM - edited 01-26-2018 10:34 AM
You also need to disable "right-click...advanced...autoadjust scales". This is enabled by default and will change the length (in pixels) of the scales to make room if the markers need more space. In your case, the y markers change between 0 and 1 decimal digits, depending on the range.
Whenever an axis changes in length, the markers are re-optimized for the available space.