简体   繁体   中英

Vega-Lite : stroke color value from data?

In Vega it is possible to take a color value from data, like that : example in Vega

Is there a way to do this with Vega-Lite ? example in Vega-Lite

Yes, you need to set the scale to null in your color property.

"encoding": {
      "x": ...,
      "y": ...,
      "color": {
        "field": "color",
        "legend": null,
        "type":"nominal",
        "scale": null
      }
    }

To directly encode the data value, the scale property can be set to null.

https://vega.github.io/vega-lite/docs/scale.html#disable

Hope it helps!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM