I'd like to be able to control bar colors based on xAxis/category label name, throughout multiple charts, while using the dataset.source
option of feeding data.
I'm guessing the solution might involve using visualMap?
customColors = {
x1: '#123',
x2: '#456',
x3: '#789',
...
}
I don't think visualMap is the way to do this, you probably want to set the colors in series:
https://echarts.apache.org/en/option.html#series-bar.data.itemStyle.color
or define a color palette:
https://echarts.apache.org/en/option.html#color
Echarts should color the chart by series by default:
https://echarts.apache.org/en/option.html#series-bar.colorBy