Number Formatting

 

Number formatting allows many different styles to be displayed on any x or y-axis.  The format string is defined by codes as outlined in the tables below, taken directly from Microsoft's MSDN library for Visual Studio 6.

XY Chart lists some number formats in the drop down on the X and Y-Axes property page (X Axes shown below).  This is only a small sample of the many possible format strings.  Any combination of the codes can be used to create specific numbering formats with prefixes ($1.00) and suffixes (1.00 USD). 

 

The following is taken directly from Microsoft's MSDN library for Visual Studio 6.  The Format function as described below is used by XY Chart for number formatting.

The following table contains some sample format expressionss for numbers. (These examples all assume that your system's locale setting is English-U.S.) The first column contains the format strings; the other columns contain the resulting output if the formatted data has the value given in the column headings.

Format (format)

Positive 5

Negative 5

Decimal .5

Null

Zero-length string ("")

5

-5

0.5

 

0

5

-5

1

 

0.00

5.00

-5.00

0.50

 

#,##0

5

-5

1

 

#,##0.00;;;Nil

5.00

-5.00

0.50

Nil

$#,##0;($#,##0)

$5

($5)

$1

 

$#,##0.00;($#,##0.00)

$5.00

($5.00)

$0.50

 

0%

500%

-500%

50%

 

0.00%

500.00%

-500.00%

50.00%

 

0.00E+00

5.00E+00

-5.00E+00

5.00E-01

 

0.00E-00

5.00E00

-5.00E00

5.00E-01

 

 

The following table identifies the predefined numeric format names:

Format name

Description

General Number

Display number with no thousand separator.

Currency

Display number with thousand separator, if appropriate; display two digits to the right of the decimal separator. Output is based on system locale settings.

Fixed

Display at least one digit to the left and two digits to the right of the decimal separator.

Standard

Display number with thousand separator, at least one digit to the left and two digits to the right of the decimal separator.

Percent

Display number multiplied by 100 with a percent sign (%) appended to the right; always display two digits to the right of the decimal separator.

Scientific

Use standard scientific notation.

Yes/No1

Display No if number is 0; otherwise, display Yes.

True/False1

Display False if number is 0; otherwise, display True.

On/Off1

Display Off if number is 0; otherwise, display On.

Notes:
1. If NumericFormat = "Yes/No", "True/False" or "On/Off" then the scale is in 'boolean' mode where the number of major ticks is limited to 2.  For example, in the case of "On/Off" and scale min value = 0 and max value = 1, a major tick value of zero will display "Off", and any other value > 0  will display "On".


To Enable Feature

To configure Date/Time along an x-axis, use X-Axes Property Page or programmatically set the XScale properties.

To configure Date/Time along a y-axis, use Y-Axes Property Page or programmatically set the YScale properties.

Example
YScale(1).FormatStyle = fsNumeric
YScale(1).NumericFormat = "
$#,##0;($#,##0)"

YScale(2).FormatStyle = fsNumeric
YScale(2).NumericFormat = "
Percent"