From 159bdc1d9c5f6da45b74cca57f00d8d78b5d0e63 Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Fri, 10 May 2024 13:52:09 -0700 Subject: [PATCH] docs(examples): add bar_label_null example --- examples/specs/bar_label_null.vl.json | 26 ++++++++++++++++++ examples/specs/point_label_null_date.vl.json | 29 ++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 examples/specs/bar_label_null.vl.json create mode 100644 examples/specs/point_label_null_date.vl.json diff --git a/examples/specs/bar_label_null.vl.json b/examples/specs/bar_label_null.vl.json new file mode 100644 index 0000000000..3b32d0d4b7 --- /dev/null +++ b/examples/specs/bar_label_null.vl.json @@ -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"} + } + }] +} diff --git a/examples/specs/point_label_null_date.vl.json b/examples/specs/point_label_null_date.vl.json new file mode 100644 index 0000000000..3fab846f78 --- /dev/null +++ b/examples/specs/point_label_null_date.vl.json @@ -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"}} + } + }] +}