Binding select_single to functions #2463
-
I would like to create a dropdown menu with the names of aggregation functions (mean, median, max), and be able to select them via clicking, and apply this function to the data on the y axis in a mark_bar chart. Is this possible? I have not found a single example of anything similar. Thanks, Gordon. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
You can't bind a select to a function, but you can use a calculate transform to pre-compute values that you then bind to a select statement. Does that make sense? |
Beta Was this translation helpful? Give feedback.
-
I have the same problem, I want to the user to use a dropdown menu to select the aggregation function and can't get it run. Is there a small example how to get this work? |
Beta Was this translation helpful? Give feedback.
-
I restarted IDE and kernel. I use the latest altair version 5.3.0. I have to say that I push the plot to streamlit. I use python 3.10.13. No luck. |
Beta Was this translation helpful? Give feedback.
Combining from this and this docpage, you could do something like: