vegalite(
{
"data": {
"values": dataset,
},
"transform": [{"calculate": "month(datum.timestamp)", "as": "time"}],
"vconcat": [
{
"width": width-50,
"mark": {"type": "line"},
"encoding": {
"x": {
"timeUnit": "yearmonthdatehoursminutessecondsmilliseconds",
"field": "timestamp",
"type": "temporal",
"axis": {
"format": "%H:%M:%S",
"title": "May 04 2019",
"titleX": 30,
"titlePadding": 10,
},
"bin": {"binned": true, "extent": {"param": "brush"}}
},
"y": { "field": "mag", "type": "quantitative", "title": "Magnitude of Acceleration→"}
}
},{
"width": width-50,
"height": 50,
"params": [{
"name": "brush",
"select": {"type": "interval", "encodings": ["x"]}
}],
"mark": "line",
"encoding": {
"x": {
"timeUnit": "yearmonthdatehoursminutes",
"field": "timestamp",
"type": "temporal",
"axis": {
"grid": false,
"format": "%H:%M",
"title": "Time (Hours:Minutes:Seconds)→",
},
},
"y": {"field": "mag", "type": "quantitative", "title": "Mag→"}
}
}]
}
)