问题
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();
    """)
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.
回答1:
Bokeh used to have resize but it died recently and won't get revived from what I read.
来源:https://stackoverflow.com/questions/48855922/bokeh-resize-plot-dynamically