Skip to content

Instantly share code, notes, and snippets.

@keckelt
Created June 9, 2021 13:19
Show Gist options
  • Save keckelt/427d0ebef3627ce82347744c731ef260 to your computer and use it in GitHub Desktop.
Save keckelt/427d0ebef3627ce82347744c731ef260 to your computer and use it in GitHub Desktop.
Custom Tick Labels
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "Google's stock price over time.",
"width": 300,
"height": 300,
"data": {
"values": [
{"label": "A", "x": 0, "y": 420},
{"label": "B", "x": 2, "y": 440},
{"label": "C", "x": 5, "y": 430},
{"label": "D", "x": 9, "y": 460},
{"label": "A", "x": 10, "y": 470}
]
},
"layer": [
{
"mark": {"type": "text", "dy": 14},
"encoding": {
"x": {
"field": "x",
"type": "quantitative",
"axis": {"labels": true, "ticks": true, "grid": false, "labelExpr": ""}
},
"y": {"value": 300},
"text": {"field": "label"}
}
},
{
"mark": {"type": "line", "point": true},
"encoding": {
"x": {"field": "x", "type": "quantitative"},
"y": {"field": "y", "type": "quantitative"}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment