Numeric Axis
18 Nov 20181 minute to read
You can use numeric axis to represent numeric values of data in chart. By default, the valueType of an axis is Double.
Range
Range for an axis, will be calculated automatically based on the provided data, you can also customize the range of the axis using minimum, maximum and interval property of the axis.
Range Padding
Padding can be applied to the minimum and maximum extremes of the axis range by using the rangePadding property. Numeric axis supports the following types of padding.
- None
- Round
- Additional
- Normal
- Auto
Numeric - None
When the rangePadding is set to None, minimum and maximum of an axis is based on the data.
Numeric - Round
When the rangePadding is set to Round, minimum and maximum will be rounded to the nearest possible value divisible by interval. For example, when the minimum is 3.5 and the interval is 1, then the minimum will be rounded to 3.
Numeric - Additional
When the rangePadding is set to Additional, interval of an axis will be padded to the minimum and maximum of the axis.
Numeric - Normal
When the rangePadding is set to Normal, padding is applied to the axis based on default range calculation.
Numeric - Auto
When the rangePadding is set to Auto, horizontal numeric axis takes None as padding calculation, while the vertical numeric axis takes Normal as padding calculation.
Label Format
Numeric Label Format
Numeric labels can be formatted by using the labelFormat property. Numeric labels supports all globalize format.
The following table describes the result of applying some commonly used label formats on numeric values.
| Label Value | Label Format property value | Result | Description |
| 1000 | n1 | 1000.0 | The Number is rounded to 1 decimal place |
| 1000 | n2 | 1000.00 | The Number is rounded to 2 decimal places |
| 1000 | n3 | 1000.000 | The Number is rounded to 3 decimal places |
| 0.01 | p1 | 1.0% | The Number is converted to percentage with 1 decimal place |
| 0.01 | p2 | 1.00% | The Number is converted to percentage with 2 decimal places |
| 0.01 | p3 | 1.000% | The Number is converted to percentage with 3 decimal places |
| 1000 | c1 | $1000.0 | The Currency symbol is appended to number and number is rounded to 1 decimal place |
| 1000 | c2 | $1000.00 | The Currency symbol is appended to number and number is rounded to 2 decimal places |
GroupingSeparator
To separate groups of thousands, use useGroupingSeparator property in chart.
Custom Label Format
Axis also supports custom label format using placeholder like {value}°C, in which the value represents the axis label e.g 20°C.