hvega-0.11.0.1: tests/specs/gallery/bar/barnegative.vl
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"values": [
{
"a": "A",
"b": -28
},
{
"a": "B",
"b": 55
},
{
"a": "C",
"b": -33
},
{
"a": "D",
"b": 91
},
{
"a": "E",
"b": 81
},
{
"a": "F",
"b": 53
},
{
"a": "G",
"b": -19
},
{
"a": "H",
"b": 87
},
{
"a": "I",
"b": 52
}
]
},
"description": "A bar chart with negative values. We can hide the axis domain line, and instead use a conditional grid color to draw a zero baseline.",
"encoding": {
"x": {
"axis": {
"domain": false,
"labelAngle": 0,
"labelPadding": 4,
"ticks": false
},
"field": "a",
"type": "ordinal"
},
"y": {
"axis": {
"gridColor": {
"condition": {
"test": "datum.value === 0",
"value": "black"
},
"value": "#ddd"
}
},
"field": "b",
"type": "quantitative"
}
},
"mark": "bar"
}