我想在binding_radio选择器中更改“此标签”的颜色:可以吗?
我什么都找不到...
任何帮助将不胜感激!
df = pd.DataFrame({'x':[0,0],'y':[10,20],'color':['red','blue']})
groups = df['y'].tolist()
radio_groups = alt.binding_radio(
options = groups,
name = 'This label'
)
select_group = alt.selection(
type = 'single',
fields = ['y'],
bind = radio_groups,
empty ='none',
init = {'y': 10}
)
alt.Chart(
df
).mark_bar(
).encode(
x = 'x:O',
y='y:O',
color = 'y:O'
).add_selection(
select_group
).transform_filter(
select_group
)