folium
folium copied to clipboard
Multiple Vincent/Vega charts in a popup?
I'm trying to add two Vincent bar charts in a popup using Vega, one on top of the other. The two methods below are not working:
# Adding both charts to add_child: This only renders the first chart
m.add_child( folium.CircleMarker(
location = [df['latitude'], df['longitude']],
popup = folium.Popup(max_width = 450).add_child(chart1, chart2)
))
# Method-chaining: This only renders the second chart
m.add_child( folium.CircleMarker(
location = [df['latitude'], df['longitude']],
popup = folium.Popup(max_width = 450).add_child(chart1, name = 'c1').add_child(chart2, name = 'c2')
) )
Is there a way to accomplish this?
I am also interested - @robroc Did you come up with a solution in the meanwhile?
@dsunjka I was never able to solve this. I ended up using a different chart type that encodes the data from two charts in one.
The underlying issue that you currently can't add multiple children to a popup, only the last one added will be used. It would be good if we either fix that, or not make it fail silently.
Same question as https://github.com/python-visualization/folium/issues/1387