I have a figure containing a segment :
p = figure(height=500, tools="pan,wheel_zoom,box_zoom,reset", x_axis_type='datetime', y_axis_location="right")
high_low_segment = p.segment(x0='time', y0='low', x1='time', y1='high', line_width=1, color='black', source=source)
(this is from the OHLC example)
I'm wondering how to change the line_width of the segment dynamically - namely when the x-scale changes (catching RangesUpdate
event) - to scale accordingly to the zoom level.
I'm new to bokeh so I'm not sure if it's possible directly in Python, if I have to wire some JS or if it's just impossible this way. Maybe I should completely rewrite my figure or remove the segment and add a new one ?
Environment:
- bokeh 2.4.0
- python 3.9.7