Skip to content

Commit

Permalink
docs(examples): add bar_label_null example
Browse files Browse the repository at this point in the history
  • Loading branch information
kanitw committed May 20, 2024
1 parent 502db1d commit 159bdc1
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
26 changes: 26 additions & 0 deletions examples/specs/bar_label_null.vl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"values": [
{"a": "Jan 1, 2000", "b": 28},
{"a": "Jan 2, 2000", "b": 55},
{"a": "Jan 3, 2000", "b": null},
{"a": "Jan 4, 2000", "b": 65},
{"a": "Jan 5, 2000", "b": 43},
{"a": null, "b": 50}
]
},

"encoding": {
"x": {"timeUnit": "yearmonthdate", "field": "a", "type": "temporal", "axis": {"format": "%d %b"}},
"y": {"field": "b", "type": "quantitative"}
},
"layer": [{
"mark": {"type": "bar", "invalid": "show"}
}, {
"mark": {"type": "text", "invalid": "show", "baseline": "bottom"},
"encoding": {
"text": {"field": "b", "type": "quantitative"}
}
}]
}
29 changes: 29 additions & 0 deletions examples/specs/point_label_null_date.vl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"values": [
{"a": "Jan 1, 2000", "b": 28},
{"a": "Jan 2, 2000", "b": 55},
{"a": "Jan 3, 2000", "b": null},
{"a": "Jan 4, 2000", "b": 65},
{"a": "Jan 5, 2000", "b": 43},
{"a": null, "b": 50}
]
},

"encoding": {
"x": {"timeUnit": "yearmonthdate", "field": "a", "type": "temporal", "axis": {"format": "%d %b"}},
"y": {"field": "b", "type": "quantitative"}
},
"layer": [{
"mark": {"type": "circle", "invalid": "show", "tooltip": true},
"encoding": {
"x": {"timeUnit": "yearmonthdate", "field": "a", "type": "temporal"}
}
}, {
"mark": {"type": "text", "invalid": "show", "baseline": "bottom"},
"encoding": {
"text": {"timeUnit": "yearmonthdate", "field": "a", "type": "temporal", "axis": {"format": "%d %b"}}
}
}]
}

0 comments on commit 159bdc1

Please sign in to comment.