Skip to main content

Hi all,


First of all, I’m discovering Vega lite and I have to say that I love it !


I’m trying to do a scatter plot, with (1) the dots being proportional to a value and (2) a text label next to each dot.


I’m actually able to do each of these in isolation but when I try to do both at the same time, the labels inherit from the dot size. Is there a way to achieve this ? Here is the configuration I’m using :


{

“$schema”: “https://vega.github.io/schema/vega-lite/v4.json”,

“title”: “Dashboard”,

“width”: “container”,

“height”: “container”,

“layer”:

{

“mark”: “circle”


},
{
"mark": {
"type": "text",
"align": "left",
"baseline": "middle",
"dx": 3
},
"encoding": {
"text": {
"field": "text_value",
"type": "nominal"
}
}
}

],

“encoding”: {

“x”: {

“field”: “x_value”,

“type”: “nominal”

},

“y”: {

“field”: “y_value”,

“type”: “quantitative”

},

“color”: {

“field”: “stage”,

“type”: “nominal”

}

,“size”: {

“field”: “size”,

“type”: “quantitative”

}

}


}

Be the first to reply!

Reply