44from bokeh .io import curdoc
55from bokeh .layouts import row , column , gridplot , layout
66from bokeh .palettes import Spectral6
7- from bokeh .models import ColumnDataSource , Range1d , LinearAxis
7+ from bokeh .models import ColumnDataSource , Range1d , LinearAxis , NumeralTickFormatter
88from bokeh .models .widgets import Select , Button
99from bokeh .plotting import figure , output_file , show
1010
@@ -76,6 +76,7 @@ def get_price_oi(data, symbol):
7676data ['date' ] = data .timestamp .dt .date .astype (str )
7777colors = Spectral6 [:len (cols )]
7878source .data = source .from_df (data )
79+ p .yaxis [0 ].formatter = NumeralTickFormatter (format = '0.00 a' )
7980p .vbar_stack (cols , width = 0.6 , x = 'index' , color = colors , source = source )
8081
8182price_data = get_price_oi (df , 'NIFTY' )
@@ -90,6 +91,7 @@ def get_price_oi(data, symbol):
9091p2 .extra_y_ranges = {'foo' : Range1d (l1 ,h1 )}
9192p2 .line ('timestamp' , 'open_int' , source = prices , y_range_name = 'foo' )
9293p2 .add_layout (LinearAxis (y_range_name = 'foo' ), 'right' )
94+ p2 .yaxis [1 ].formatter = NumeralTickFormatter (format = '0.0 a' )
9395
9496pct_change = data [['date' , 'combined_oi' ]].copy ()
9597pct_change ['date' ] = pd .to_datetime (pct_change ['date' ])
0 commit comments