{ "$schema": "https://vega.github.io/schema/vega/v5.json", "description": "Using format parse to parsing of input time data as utc time.", "background": "white", "padding": 5, "width": 20, "style": "cell", "data": [ { "name": "source_0", "values": [ {"date": "10 Oct 2011 22:48:00"}, {"date": "11 Oct 2022 23:00:00"} ] }, { "name": "data_0", "source": "source_0", "transform": [ { "type": "formula", "expr": "utcParse(datum[\"date\"],'%d %b %Y %H:%M:%S')", "as": "date" }, { "field": "date", "type": "timeunit", "units": ["hours", "minutes"], "as": ["hoursminutes_date", "hoursminutes_date_end"] } ] } ], "signals": [ {"name": "y_step", "value": 20}, { "name": "height", "update": "bandspace(domain('y').length, 1, 0.5) * y_step" } ], "marks": [ { "name": "marks", "type": "symbol", "style": ["point"], "from": {"data": "data_0"}, "encode": { "update": { "opacity": {"value": 0.7}, "fill": {"value": "transparent"}, "stroke": {"value": "#4c78a8"}, "ariaRoleDescription": {"value": "point"}, "description": { "signal": "\"time: \" + (timeFormat(datum[\"hoursminutes_date\"], timeUnitSpecifier([\"hours\",\"minutes\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})))" }, "x": {"signal": "width", "mult": 0.5}, "y": {"scale": "y", "field": "hoursminutes_date"} } } } ], "scales": [ { "name": "y", "type": "point", "domain": {"data": "data_0", "field": "hoursminutes_date", "sort": true}, "range": {"step": {"signal": "y_step"}}, "padding": 0.5 } ], "axes": [ { "scale": "y", "orient": "left", "grid": false, "title": "time", "format": { "signal": "timeUnitSpecifier([\"hours\",\"minutes\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" }, "formatType": "time", "labelOverlap": true, "zindex": 0 } ] }