散景动态调整大小图 [英] Bokeh resize plot dynamically
本文介绍了散景动态调整大小图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有Bokeh 0.12.6, 我做什么
i have Bokeh 0.12.6, what i do
p2 = figure(x_axis_type="datetime", plot_width=1500,plot_height=700,
x_range=p1.x_range, title="")
select = Select(title="SELECT", options=["val1", "val2", "val3"])
select.callback = CustomJS(args={'plot1': p1, 'plot2': p2}, code="""
if(cb_obj.value === "val1"){
plot2.width = 1500;
}else{
plot2.width = 700;
}
plot2.document.resize();
""")
我需要通过单击下拉列表来调整图的大小,但是我收到了js错误,
document.resize不是函数.我也尝试了plot2.change.emit();
但是只有当我更改Chrome中的显示宽度时,绘图才会更改.
如何动态更改绘图属性,例如宽度,高度,线条属性等.
谢谢.
I need to resize plot by clicking dropdown but i recieve js error that
document.resize is not a function. Also i tried plot2.change.emit();
but plot changed only if i change display width in Chrome.
How to dinamically change plot properties such as width, height, lines properies etc.. ?
Thanks.
推荐答案
Bokeh used to have resize but it died recently and won't get revived from what I read.
这篇关于散景动态调整大小图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文