I have this vega-lite spec and I'd like to show the day and month in the x axis from an epoch timestamp:
{
"data": {
"values": [
{"date": "1325376000000", "price": 0},
{"date": "1325462400000", "price": 100},
{"date": "1325548800000", "price": 30}
]
},
"mark": "line",
"encoding": {
"x": {"field": "date"},
"y": {"field": "price", "type": "quantitative"}
},
"width": "container"
}
This is the current result:
I tried using transformations with no luck.
You mean like this?
{
"data": {
"values": [
{"date": "1325376000000", "price": 0},
{"date": "1325462400000", "price": 100},
{"date": "1325548800000", "price": 30}
],
"format": {"parse": {"date": "date:'%Q'"}}
},
"mark": "line",
"encoding": {
"x": {"field": "date", "timeUnit": "yearmonthdate", "type": "ordinal"},
"y": {"field": "price", "type": "quantitative"}
},
"width": "container"
}