Formatting

Formatting

The top labels are always formatted by the sap.ui.core.format.NumberFormat.

The bottom labels are formatted by the number or date formatter depending on the dimensions property's type and its annotations:

Formatted Bottom Labels in Different Annotation Cases

Types of dimensions Property

Annotations

Raw Value

X-coordinate Value

Formatted Value for Bottom Label

Any type

sap:text= DateLabel (or has annotation Common.Text whose Path = DateLabel)

"any text" (raw value of DateLabel property)

Depends on property type (use index value if neither date nor number type is present)

'any text'

Edm.String

sap:semantics = year (or has annotation IsCalendarYear)

2016

Timestamp

1/1/16

Edm.String

sap:semantics = yearmonth (or has annotation IsCalendarYearMonth)

201612

Timestamp

12/1/16

Edm.String

sap:semantics = yearmonthday (or has annotation IsCalendarDate)

20161225

Timestamp

12/25/16

---

'any text'

Indices

Edm.DateTime

/Date(1472629368000)/

Timestamp

8/31/16

Edm.Int32 or other number types

20000

20000

20K

  • If the dimensions property has an OData V2 annotation sap:text (or an ODataV4 annotation Common.Text) pointing to another property, that property's value is used to display the bottom label, no matter what the primary property's data type is. The x-coordinate's value depends on the primary property's data type. If its type is DateTime, the date is converted to a timestamp; if it has a numeric type, the value is used directly. In other cases, each point's index from within the data list is used, causing an even distribution of points on the x-axis.

  • If the type of the dimensions property is string and it has an OData V2 annotation sap:semantics (or the OData V4 annotation IsCalendarYear, or similar), the raw value is formatted to a shortened date string based on the pattern provided by sap:semantics (or a corresponding pattern of IsCalendarYear). The value of the x-coordinate is set to the formatted date's timestamp. The bottom label displays the formatted short date.
  • If the type of the dimensions property is DateTime or another numeric type without any of the annotations mentioned above, the raw value is formatted by the number formatter or date formatter depending on the data type. Each point's x-coordinate value is set to the date's timestamp representation if its type is DateTime, and to a numeric value if its type is numeric.