i have two bar chart that vertically stacked. i use blow code for change color of them.
alt.Color('variable', domain=['a','b','c'],range=['#for_a','#for_b','#for_c']
problem is, when i set color for one of them, other chart disappear or, when set color for both (when i set domain and range for both), color of one affect other bar. how solve that?
chart_a = alt.Chart(dfA).mark_bar().encode(
alt.X('monthdate(date):O'),
alt.Y('value'),
alt.Color('variable',
scale=alt.Scale(domain=['a','b'],
range=['green','yellow'])
)
chart_b =alt.Chart(dfB).mark_bar().encode(
alt.X('monthdate(date):O'),
alt.Y('value'),
alt.Color('variable',
scale=alt.Scale(domain=['c','d','e','f'],
range=['#ffbb9e','#992e00','#9ecdff','#005799']),
)
)
chart_a & chart_b