Sizing Mode --> stretch width for multile rows chart

Hello all,

dont you know what I do wrong when I apply sizin_mode to 2 figures?

import numpy as np

from bokeh.layouts import column
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, show
from bokeh.sampledata.stocks import AAPL

dates = np.array(AAPL['date'], dtype=np.datetime64)
source = ColumnDataSource(data=dict(date=dates, close=AAPL['adj_close']))

p = figure(height=300, width = 800, sizing_mode = "stretch_width", tools="xpan", toolbar_location="below",
           x_axis_type="datetime", x_axis_location="below",
           background_fill_color="#efefef", x_range=(dates[1500], dates[2500]))

p.line('date', 'close', source=source)
p.yaxis.axis_label = 'Price'

select = figure(height=30, width = p.width, sizing_mode = "stretch_width", y_range = [0,30],x_range = [0,800],
                x_axis_type=None, y_axis_type=None,
                tools="", toolbar_location=None, background_fill_color="#efefef")

select.text(
        x = [0, 200, 500], 
        y = [0 , 0, 0], 
        text = ["Maximum: ", "Minimum: ", "Difference: "],
        text_color="black")

select.text(
        x = [90, 280, 590], 
        y = [1 , 1, 1], 
        text = ["32", "2", "30"],
        text_color="green")

select.ygrid.grid_line_color = None
select.xgrid.grid_line_color = None

show(column(select, p))

I tried multiple variation of that but with no sucess.

Can you help?

thank you

Jan

1 Like

Found it, it is parramenter of Column.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.