Replies: 1 comment
-
|
As a workaround I converted dates to timestamps (integers) and used scale |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm quite new to vega, so not sure if I'm doing it right, but I'm trying to assign colors according to date column, however I get pretty limited color range, as you can see in the first image. Then I changed color field to
color2with typequantitativeand got full range of colors as expected, so what's wrong with temporal scale? Can I get same color range with it?{ "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": { "values": [ {"color": "2022-01-01", "color2": 1, "y": 1}, {"color": "2022-01-02", "color2": 2, "y": 1}, {"color": "2022-01-03", "color2": 3, "y": 1} ] }, "mark": "bar", "encoding": { "y": {"aggregate": "sum", "field": "y"}, "color": { "field": "color", "type": "temporal", "scale": {"scheme": "turbo"} } } }Open the Chart in the Vega Editor
Beta Was this translation helpful? Give feedback.
All reactions