Time Unit
{
"data": ... ,
"mark": ... ,
"encoding": {
"x": {
"timeUnit": ..., // time unit
"field": ...,
"type": "temporal",
...
},
"y": ...,
...
},
...
}
timeUnit
property of a channel definition sets the level of specificity for a temporal field. Currently supported values are:
-
Non-periodic Time Unit:
'year'
,'yearmonth'
,'yearmonthday'
,'yearmonthdate'
,'yearday'
,'yeardate'
,'yearmonthdayhours'
,'yearmonthdayhoursminutes'
. -
Periodic Time Unit:
'month'
,'day'
,'date'
,'hours'
,'minutes'
,'seconds'
,'milliseconds'
,'hoursminutes'
,'hoursminutesseconds'
,'minutesseconds'
,'secondsmilliseconds'
.
Example
This example shows temperature in Seattle over the months.