Skip to content

Commit 4c475a2

Browse files
committed
ticks changed to millions
1 parent 2f19d1c commit 4c475a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

oi_graph/futures_oi.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from bokeh.io import curdoc
55
from bokeh.layouts import row, column, gridplot, layout
66
from bokeh.palettes import Spectral6
7-
from bokeh.models import ColumnDataSource, Range1d, LinearAxis
7+
from bokeh.models import ColumnDataSource, Range1d, LinearAxis, NumeralTickFormatter
88
from bokeh.models.widgets import Select, Button
99
from bokeh.plotting import figure, output_file, show
1010

@@ -76,6 +76,7 @@ def get_price_oi(data, symbol):
7676
data['date'] = data.timestamp.dt.date.astype(str)
7777
colors = Spectral6[:len(cols)]
7878
source.data = source.from_df(data)
79+
p.yaxis[0].formatter = NumeralTickFormatter(format='0.00 a')
7980
p.vbar_stack(cols, width=0.6, x='index', color=colors, source=source)
8081

8182
price_data = get_price_oi(df, 'NIFTY')
@@ -90,6 +91,7 @@ def get_price_oi(data, symbol):
9091
p2.extra_y_ranges = {'foo': Range1d(l1,h1)}
9192
p2.line('timestamp', 'open_int', source=prices, y_range_name='foo')
9293
p2.add_layout(LinearAxis(y_range_name='foo'), 'right')
94+
p2.yaxis[1].formatter = NumeralTickFormatter(format='0.0 a')
9395

9496
pct_change = data[['date', 'combined_oi']].copy()
9597
pct_change['date'] = pd.to_datetime(pct_change['date'])

0 commit comments

Comments
 (0)