Versions Compared
Version | Old Version 5 | New Version 6 |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Class graphomate.ui.ExtendedNumberFormat
extends sap.ui.core.Element
Quick Start
Creates a number format definition that can be used for example in the aggregations "extendedNumberFormat" and "extendedNumberFormatPercent" of a graphomate.ui.charts.Chart. It will be applied to number labels if the label format mode is set to extended.
Code Block | ||||
---|---|---|---|---|
| ||||
var chart = new graphomate.ui.charts.Chart({ chartType: graphomate.ui.charts.enums.ChartType.Bar, series1: [5, 16, 17, 20], labelFormatMode: graphomate.ui.enums.LabelFormatMode.Extended, extendedNumberFormat: new graphomate.ui.ExtendedNumberFormat({ suffix: "$", decimalPlaces: 2 }) }); |
Constructor Details
new graphomate.ui.ExtendedNumberFormat(id?:string, settings?:object)
Accepts an id and a settings object or one or none of them. The settings object defines initial property values. Every setting can also be set using the related setter method. The supported settings are:
Properties:
- negativeSign : string (default: "-")
- prefix : string (default: "")
- thousandsSeparator : string (default: ".")
- decimalSeparator : string (default: ",")
- scalingFactorExponent : int (default: 0)
- decimalPlaces : graphomate.ui.types.UnsignedInteger (default: 1)
- suffix : string (default: "")
Property Details
Each property "sampleProperty" can be set using the related setter "setSampleProperty". Each setter expects a valid value for the related property as input parameter and throws an exception for invalid values. It returns the "this context" for method chaining. Each property "sampleProperty" can also be gotten using the related getter method "getSampleProperty". It expects no input parameters and returns the current value of the related property. Each property that represents or partially contains indices excepts a 0 based index.
The following properties are available:
Property Name | Type | Description |
---|---|---|
negativeSign | string | Sets a prefix for negative numbers. |
prefix | string | Sets a prefix for all formatted numbers. |
thousandsSeparator | string | Sets the thousands separator sign. |
decimalSeparator | string | Sets the decimal separator sign. |
scalingFactorExponent | int | Sets the power of ten that will be used as a scaling factor. A value of -3 for this property for example would cause a value label to be multiplied by 10-3 |
decimalPlaces | graphomate.ui.types.UnsignedInteger | Sets the number of decimal places. |
suffix | string | Sets a suffix for all formatted numbers. |