![](/img/trans.png)
[英]Python: Altair: Conditionally change axis label appearance (color, opacity)
[英]Altair change color of label in binding_radio
我想在 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
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.