Consider the following code adapted from: Altair website
import altair as alt
import pandas as pd
source = pd.DataFrame({
'a': ['A', 'B', 'B', 'B', 'E', 'F', 'G', 'H', 'I'],
'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]
})
alt.Chart(source).mark_bar().encode(
x='a',
y='b:Q'
).interactive()
Outputs this plot:
Which is interactive (we can zoom in). However, if I change the Y encoding field to the following (which is what I need) - by adding an Aggregative function:
import altair as alt
import pandas as pd
source = pd.DataFrame({
'a': ['A', 'B', 'B', 'B', 'E', 'F', 'G', 'H', 'I'],
'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]
})
alt.Chart(source).mark_bar().encode(
x='a',
y='sum(b):Q'
).interactive()
The plot is no longer interactive. Is it possible to make it interactive while using an Aggregative Function, ie: move it around, zoom in, zoom out?
Thank you :)
