Last active
April 26, 2022 01:55
-
-
Save Dulani/a9b017cf43f42a63ee099f68c67da3f9 to your computer and use it in GitHub Desktop.
Vertical rule using datasets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Vertical rule using datasets */ | |
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"datasets": { | |
"linedata": [ | |
{"a": 1, "b": 30}, | |
{"a": 2, "b": 45}, | |
{"a": 3, "b": 50}, | |
{"a": 4, "b": 60}, | |
{"a": 5, "b": 70}, | |
{"a": 6, "b": 80}, | |
{"a": 7, "b": 70}, | |
{"a": 8, "b": 50}, | |
{"a": 9, "b": 10} | |
], | |
"ruledata": {"ownval":5} | |
}, | |
"layer": [ | |
{ | |
"data": {"name": "linedata"}, | |
"mark": {"type":"line", "size": 2}, | |
"encoding": { | |
"x": {"field": "a", "type": "quantitative"}, | |
"y": {"field": "b", "type": "quantitative"} | |
} | |
}, | |
{ | |
"data": {"name": "ruledata"}, | |
"mark": {"type": "rule", "strokeDash": [4, 4], "size": 2, "color": "grey"}, | |
"encoding": { | |
"x": {"field": "ownval", "type": "quantitative"} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://vega.github.io/editor/#/gist/a9b017cf43f42a63ee099f68c67da3f9/spec.json