{ "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "layer": [ { "data": { "values": [ { "Value": 54.8, "Day": 1 }, { "Value": 112.1, "Day": 2 }, { "Value": 63.6, "Day": 3 }, { "Value": 37.6, "Day": 4 }, { "Value": 79.7, "Day": 5 }, { "Value": 137.9, "Day": 6 }, { "Value": 120.1, "Day": 7 }, { "Value": 103.3, "Day": 8 }, { "Value": 394.8, "Day": 9 }, { "Value": 199.5, "Day": 10 }, { "Value": 72.3, "Day": 11 }, { "Value": 51.1, "Day": 12 }, { "Value": 112, "Day": 13 }, { "Value": 174.5, "Day": 14 }, { "Value": 130.5, "Day": 15 } ] }, "layer": [ { "mark": "bar", "encoding": { "x": { "field": "Day", "type": "ordinal", "axis": { "labelAngle": 0 } }, "y": { "field": "Value", "type": "quantitative" } } }, { "transform": [ { "filter": "datum.Value >= 300" }, { "as": "baseline", "calculate": "300" } ], "mark": "bar", "encoding": { "color": { "value": "#e45755" }, "x": { "field": "Day", "type": "ordinal", "axis": { "labelAngle": 0 } }, "y2": { "field": "Value" }, "y": { "field": "baseline", "type": "quantitative" } } } ] }, { "data": { "values": [ { "ThresholdValue": 300, "Threshold": "hazardous" } ] }, "layer": [ { "mark": "rule", "encoding": { "y": { "field": "ThresholdValue", "type": "quantitative" } } }, { "mark": { "dx": -2, "dy": -4, "align": "right", "type": "text" }, "encoding": { "text": { "field": "Threshold", "type": "ordinal" }, "x": { "value": "width" }, "y": { "field": "ThresholdValue", "type": "quantitative", "axis": { "title": "PM2.5 Value" } } } } ] } ], "description": "Bar chart that highlights values beyond a threshold. The PM2.5 value of Beijing observed 15 days, highlighting the days when PM2.5 level is hazardous to human health. Data source https://chartaccent.github.io/chartaccent.html" }