Reputation: 874
I have a data below:
xmin xmax ymin ymax
2 4 1 2
4 6 2 3
I wanted to generate a shape which I can use to fill in values. Please assist.
Thank you
Upvotes: 1
Views: 105
Reputation: 30209
Create your data like this.
Make sure every column says do not aggregate. Import the Deneb visual from marketplace. Add the fields to the Deneb visual well as follows:
Paste the following code into Deneb.
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": 300,
"height": 240,
"background": "white",
"data": {"name": "dataset"},
"layer": [
{
"mark": {"type": "rect", "color": "#9bc2e6"}
}
],
"encoding": {
"x": {
"field": "xmin",
"type": "quantitative",
"scale": {"domain": [0, 10]}
},
"x2": {"field": "xmax"},
"y": {
"field": "ymin",
"type": "quantitative",
"scale": {"domain": [8, 0]}
},
"y2": {"field": "ymax"},
"color":{"field": "id"}
}
}
That's it.
Upvotes: 2