Hi.
How to create borders on specific values like this?
Below is the code I currently use. I’d like to know how to implement a rectangle-like border on my “Meta Diaria” text.
Thanks
Current code
{
“data”: {“name”: “dataset”},
“config”: {
“view”: {“stroke”: “transparent”}
},
“layer”: [
{
“mark”: {
“type”: “area”,
“interpolate”: “natural”,
“point”: {“color”: “green”},
“tooltip”: true,
“grid”: null,
“line”: {“color”: “green”},
“color”: {
“x1”: 0,
“x2”: 0,
“y1”: 0,
“y2”: 1,
“gradient”: “linear”,
“stops”: [
{
“offset”: 0,
“color”: “green”
},
{
“offset”: 1,
“color”: “white”
}
],
“point”: {
“filled”: true,
“color”: “#4B7430”
}
}
}
},
{
“mark”: “rule”,
“tooltip”: true,
“encoding”: {
“x”: {
“aggregate”: “mean”,
“field”: “Meta Diaria”,
“type”: “quantitative”,
“labelOpacity”: 0,
“title”: null,
“axis”: null
},
“color”: {“value”: “#BEB70C”},
“size”: {“value”: 3}
}
},
{
“mark”: {
“type”: “text”,
“dy”: -20,
“dx”: -10,
“baseline”: “bottom”,
“align”: “top”,
“fontSize”: 14,
“fontWeight”: “700”,
“fontStyle”: “italic”
},
“encoding”: {
“text”: {
“field”: “Meta Diaria”,
“format”: “.2f”,
“aggregate”: “aggregate”
},
“x”: {“axis”: null},
“color” : {“condition”: [
{“test”: “datum[‘Meta Diaria’] > 0”, “value”: “#A6E8D1”}
],
“value”: null}
}
},
{
"mark": {
"type": "text",
"dx": -8,
"dy": -10,
"color": "white",
"baseline": "middle",
"align": "top",
"fontSize": 14
},
"encoding": {
"text": {
"field": "Faturamento",
"format": ".2f"
}
}
}
],
“encoding”: {
“x”: {
“field”: “Dia Mes”,
“type”: “nominal”,
“axis”: {
“title”: null,
“labelAngle”: 0,
“labelColor”: “White”,
“labelFontSize”: 12,
“orient”: “bottom”
}
},
“y”: {
“field”: “Faturamento”,
“type”: “quantitative”,
“title”: null,
“axis”: null
}
}
}