【发布时间】:2020-05-06 22:08:27
【问题描述】:
我正在尝试使用 Bokeh 和 python 将报告导出为 HTML。谁能告诉我,为什么我的代码不起作用?我尝试打印一个简单的 Div 并成功,但只要我包含绘图,浏览器仍会打开,但什么都看不到。是不是不能继承Figure?
我将其简化为相关部分:
def export_html(self):
plots=[]
plots.append(PlotObject(self.plot_attributes[4]))
VisuLog(plots)
from bokeh.plotting import Figure, show, output_file
class VisuLog():
def __init__(self,plots):
self.plots = plots
filename="Report_"
output_file("visu_out\\"+ filename + ".html", title=filename)
show(self.plots) # open a browser
class PlotObject(Figure):
def __init__(self,plot_attributes):
super(PlotObject, self).__init__()
感谢您的帮助。
【问题讨论】: