I’m drawing a chart from some JSON and want to colour the bars depending on a field in the data: green on ‘success’ and red on ‘failed’. This sounds like it should be trivial but for some reason I’m stuggling to make it actually work… Anyone got an example of mapping a set of values to specific colours?
So I was on the right track with the scaleOrdinal at least. I’m using Plot.barX(), but fill: d => colourmap(d.status) appears to be using the ‘green’ and ‘red’ as opaque strings and keying them into the standard colour map.