A bar chart encoding color names in the data
A bar chart that directly encodes color names in the data.
View this example in the online editor
Vega-Lite JSON Specification
{
"$schema": "https://vega.github.io/schema/vega-lite/v3.json",
"description": "A bar chart that directly encodes color names in the data.",
"data": {
"values": [
{
"color": "red",
"b": 28
},
{
"color": "green",
"b": 55
},
{
"color": "blue",
"b": 43
}
]
},
"mark": "bar",
"encoding": {
"x": {
"field": "color",
"type": "nominal"
},
"y": {
"field": "b",
"type": "quantitative"
},
"color": {
"field": "color",
"type": "nominal",
"scale": null
}
}
}