{ "$schema": "https://vega.github.io/schema/vega/v5.json", "background": "white", "padding": 5, "width": 800, "height": 300, "style": "cell", "data": [ { "name": "source_0", "values": [ {"ts": 1500400000000, "v": 1}, {"ts": 1500500000000, "v": 2}, {"ts": 1500600000000, "v": 3}, {"ts": 1500700000000, "v": 2} ] }, { "name": "data_0", "source": "source_0", "transform": [ {"type": "formula", "expr": "toDate(datum[\"ts\"])", "as": "ts"} ] } ], "marks": [ { "name": "marks", "type": "line", "style": ["line"], "sort": {"field": "datum[\"ts\"]"}, "from": {"data": "data_0"}, "encode": { "update": { "stroke": {"value": "#4c78a8"}, "description": { "signal": "\"ts: \" + (timeFormat(datum[\"ts\"], '%b %d, %Y')) + \"; v: \" + (format(datum[\"v\"], \"\"))" }, "x": {"scale": "x", "field": "ts"}, "y": {"scale": "y", "field": "v"}, "defined": { "signal": "isValid(datum[\"ts\"]) && isFinite(+datum[\"ts\"]) && isValid(datum[\"v\"]) && isFinite(+datum[\"v\"])" } } } } ], "scales": [ { "name": "x", "type": "time", "domain": { "fields": [ {"signal": "{data: datetime(1500000000000)}"}, {"signal": "{data: datetime(1500900000000)}"} ] }, "range": [0, {"signal": "width"}] }, { "name": "y", "type": "linear", "domain": [0, 5], "range": [{"signal": "height"}, 0], "zero": true } ], "axes": [ { "scale": "x", "orient": "bottom", "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "y", "orient": "left", "gridScale": "x", "grid": true, "tickCount": {"signal": "ceil(height/40)"}, "domain": false, "labels": false, "aria": false, "maxExtent": 0, "minExtent": 0, "ticks": false, "zindex": 0 }, { "scale": "x", "orient": "bottom", "grid": false, "title": "ts", "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, "zindex": 0 }, { "scale": "y", "orient": "left", "grid": false, "title": "v", "labelOverlap": true, "tickCount": {"signal": "ceil(height/40)"}, "zindex": 0 } ] }