graph » scale-x » transform

transform

[ root » graph » scaleX » transform ]

Time-Series Charts Only: Use the transform object to convert Unix timestamps into a more readable format. ZingChart accepts Unix time values in milliseconds, and timestamps can be calculated with online conversion tools such as Epoch Converter.


all (String)

To format your date values. Use this attribute with the type value (set to true).

Token Description
%A Displays the ante or post meridiem time in upper case letters: AM or PM.
%a Displays the ante or post meridiem time in lower case letters: am or pm.
%D Displays the day of the week in abbreviated form: Sun, Mon, Tue, Wed, Thu, Fri and Sat.
%d Displays the day's date without a leading 0 if the date is single digit.
%dd Displays the day's date with a leading 0 if the date is single digit.
%G Displays the hour in 24-hour format without a leading 0.
%g Displays the hour in 12-hour format without a leading 0.
%H Displays the hour in 24-hour format with a leading 0 if the hour is single digit.
%h Displays the hour in 12-hour format with a leading 0 if the hour is single digit.
%i Displays the minutes.
%M Displays the month in abbreviated form: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov and Dec.
%m Displays the month numerically without a leading 0 if the date is single digit.
%mm Display the month numerically with a leading 0 if the month is single digit.
%q Displays the milliseconds.
%s Displays the seconds.
%Y Displays the year in 4-digit format.
%y Displays the year in 2-digit format.

'%M' | '%M %d' | '%M %d %H:%i' | ...



AttributeTypeDescription
allStringFormats date values when `type: "date"`.
Default Value: null
itemObjectTo set transform item label. This is only available for scaleX object.
Default Value: null
textStringSets the text of the scale label. If `type: "date"` is set within same object, date-related tokens (%M, %d, ...) can be used in this attribute.
Default Value: null
typeStringSet to "date" to convert Unix timestamps into dates.
Accepted Values: ['date']
Default Value: null
uniformBooleanTo set the time-series scale to linear (uniform) or non-linear.
Default Value: null