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: 

Scatter graph problems

Hi to everyone,
I'm using a scatter graph (Measurement Studio 8.1.2.472) to display data of different type (digital and analog).
The first question is about X axes that represent a time for 0 to a max than can be 4ms or 4s or ...4h
Is possible to display the major divisions label in SI units with 6 decimal digits and hide trailing zero ?
With  label format = engeneering s0, the first and the last label have a lot of digit and is not good.
Engeneering s6, produces 6 digits after the decimal point, but always visible.
.###### produces 6 digits after the decimal point, if it's necessary, but not in SI units.
Any suggestion ?

The second and last question is about the project (Visual C# 2005) in attachmet that use the same scatter graph.
Example data are stored in 2 files (x.dat and y.dat, two array of double) and plotted with some error that are visible by panning the graph.
The data are digital data, so only vertical transition are possible, but by panning the graph some transition changes and it's not vertical ! And the data are always the same.
By zooming the graph the problem disappear.
It's a bug of a graph or a bug in my code ?
Any suggestion to solve this big problem ?
Thanks in advance.

Filippo
0 Kudos
Message 1 of 2
(3,648 Views)

Hi Garraty,

Sorry for the delayed response.

Regarding your first question, if label format = engeneering s0 works for you, and you only don't like the first and last labels, then you can try setting the EndLabelsAlwaysVisible property on the XAxis to false.

If this doesn't work, then you can always customize the FormatString, by doing something like this:
    private class CustomFormatString : FormatString
    {
        public CustomFormatString()
            : base(FormatStringMode.Engineering, "s6") // or any other that comes close to what you need.
        {
        }
        public override string FormatDouble(double value)
        {
            string myCustomString = base.FormatDouble(value);
            /* modify the myCustomString to how you need */
            return myCustomString;
        }
    }

and apply your custom formatter to the MajorDivisions, something like this:
xyPlotXAxis.MajorDivisions.LabelFormat = new CustomFormatString();


Regarding your second question, thanks for reporting the issue. We have identified this as a bug in our ScatterGraph control. We will have a fix available for this problem in an upcoming release of Measurement Studio after 8.5.

-Mahesh
National Instruments
0 Kudos
Message 2 of 2
(3,536 Views)