4
4
from bokeh .io import curdoc
5
5
from bokeh .layouts import row , column , gridplot , layout
6
6
from bokeh .palettes import Spectral6
7
- from bokeh .models import ColumnDataSource , Range1d , LinearAxis
7
+ from bokeh .models import ColumnDataSource , Range1d , LinearAxis , NumeralTickFormatter
8
8
from bokeh .models .widgets import Select , Button
9
9
from bokeh .plotting import figure , output_file , show
10
10
@@ -76,6 +76,7 @@ def get_price_oi(data, symbol):
76
76
data ['date' ] = data .timestamp .dt .date .astype (str )
77
77
colors = Spectral6 [:len (cols )]
78
78
source .data = source .from_df (data )
79
+ p .yaxis [0 ].formatter = NumeralTickFormatter (format = '0.00 a' )
79
80
p .vbar_stack (cols , width = 0.6 , x = 'index' , color = colors , source = source )
80
81
81
82
price_data = get_price_oi (df , 'NIFTY' )
@@ -90,6 +91,7 @@ def get_price_oi(data, symbol):
90
91
p2 .extra_y_ranges = {'foo' : Range1d (l1 ,h1 )}
91
92
p2 .line ('timestamp' , 'open_int' , source = prices , y_range_name = 'foo' )
92
93
p2 .add_layout (LinearAxis (y_range_name = 'foo' ), 'right' )
94
+ p2 .yaxis [1 ].formatter = NumeralTickFormatter (format = '0.0 a' )
93
95
94
96
pct_change = data [['date' , 'combined_oi' ]].copy ()
95
97
pct_change ['date' ] = pd .to_datetime (pct_change ['date' ])
0 commit comments