DrW*_*Man 4 html javascript json vega-lite
在 Vega 中,可以从数据中获取颜色值,例如:Vega 中的示例
有没有办法用 Vega-Lite 做到这一点?Vega-Lite 中的示例
是的,您需要在颜色属性中设置scaleto null。
"encoding": {
"x": ...,
"y": ...,
"color": {
"field": "color",
"legend": null,
"type":"nominal",
"scale": null
}
}
Run Code Online (Sandbox Code Playgroud)
要直接对数据值进行编码,可以将 scale 属性设置为 null。
https://vega.github.io/vega-lite/docs/scale.html#disable
希望能帮助到你!!
| 归档时间: |
|
| 查看次数: |
328 次 |
| 最近记录: |