I searched for this topic but I didn’t find it, so sorry if I missed it.
I want to embed a plot on a (web2py) page.
I want to get the script and div.
I only get these after I do bar_plot.show() or I get the error "AttributeError: Bar object has no attribute ‘chart’.
This opens a new browser tab and I don’t need that.
Some time ago I read about this but I can’t find it anymore.
The code is like:
import bokeh as bokeh
from bokeh.charts import Bar
iata_bar = Bar(df_iata_plot, filename=“iata_bar.html”)
#iata_bar_script, iata_bar_div = bokeh.embed.components(iata_bar.chart.plot , bokeh.resources.CDN)
#iata_bar_html = bokeh.embed.components(iata_bar.chart.plot , bokeh.resources.CDN)
iata_bar_html = bokeh.embed.file_html(iata_bar.chart.plot , bokeh.resources.CDN, “ASR-IATA”)
How can I get the script and div without the show() ?
Thanks, keep up the good work !