NumericOptions.Format Property
Gets or sets a value that specifies the formatting applied to numeric values.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.1.dll
NuGet Package: DevExpress.Charts
Declaration
Property Value
Type | Description |
---|---|
NumericFormat | A NumericFormat enumeration value. |
Available values:
Name | Description |
---|---|
General | Displays numbers without any specific formatting applied to them. Integer and fractional parts are separated using the decimal symbol specified in your computer’s regional settings. Example: 100. |
Scientific | Displays numbers using the standard scientific notation. This format is determined by your computer’s regional settings. Example: 1.00E+002. |
FixedPoint | Displays numbers as real numeric values with the specified number of digits for the fractional part. How many digits is specified by the NumericOptions.Precision property, and the decimal separator is based upon your computer’s regional settings. Example: 100.00. |
Currency | Displays numbers as currency, using the currency format specified in your computer’s regional settings. Example: $100. |
Percent | Displays numbers multiplied by 100 with a percent sign (%) appended to the right; displays two digits to the right of the symbol specified in your computer’s regional settings. Example: 100 %. |
Number | Displays numbers as numeric values, using the number format specified in your computer’s regional settings. Example: 100.00. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to Format |
---|---|
PointOptions |
|
PointOptions |
|
Remarks
Use the Format property, to define the appropriate format for numeric values representation in the axis labels, series point labels or in legend.
For example, the following image demonstrates the currency formatting applied to series points values, expressed by the $ sign added to the values.
For more information on using this property, refer to Axis Scale Types.
Example
This example demonstrates how to make series point labels of a pie chart show their values as percentages.
Note that to achieve this at runtime, you should cast the series’ SeriesBase.PointOptions to the PiePointOptions type.
// Make the series points' values to be displayed as percents.
((PiePointOptions)series1.PointOptions).PercentOptions.ValueAsPercent = true;
((PiePointOptions)series1.PointOptions).ValueNumericOptions.Format = NumericFormat.Percent;
((PiePointOptions)series1.PointOptions).ValueNumericOptions.Precision = 0;