Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add example with custom tick label strings #7047

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions examples/specs/circle_custom_tick_labels.vl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"url": "data/movies.json"
},
"mark": {"size": 80, "type": "circle"},
"encoding": {
"x": {
"aggregate": "mean",
"axis": {
"labelExpr": "datum.label == 0 ? 'Poor' : datum.label == 5 ? 'Neutral' : 'Great'",
"labelFlush": false,
"values": [0, 5, 10]
},
"field": "IMDB Rating",
"scale": {"domain": [0, 10]},
"title": null
},
"y": {"field": "Major Genre", "sort": "x", "title": null}
}
}
5 changes: 5 additions & 0 deletions site/_data/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
{
"name": "scatter_image",
"title": "Image-based Scatter Plot"
},
{
"name": "circle_custom_tick_labels",
"description": "After using the numerical values to calculate the average rating, they are replaced by string labels.",
"title": "Strip plot with custom axis tick labels"
}
],
"Line Charts": [
Expand Down