File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,13 @@ def get_open_interest(data, symbol):
47
47
button = Button (label = 'Refresh' , button_type = "success" )
48
48
49
49
# Create plots
50
- p = figure (title = 'Open interest chart for NIFTY futures' )
50
+ p = figure (title = 'Open interest chart for NIFTY futures' ,
51
+ tooltips = [
52
+ ('date' , '@date' ),
53
+ ('value' , '$y{0 a}' )
54
+ ])
51
55
cols , data = get_open_interest (df , 'NIFTY' )
56
+ data ['date' ] = data .timestamp .dt .date .astype (str )
52
57
colors = Spectral6 [:len (cols )]
53
58
source .data = source .from_df (data )
54
59
print (cols , colors )
@@ -58,6 +63,7 @@ def get_open_interest(data, symbol):
58
63
def update ():
59
64
symbol = select_symbol .value
60
65
cols , data = get_open_interest (df , symbol )
66
+ data ['date' ] = data .timestamp .dt .date .astype (str )
61
67
source .data = source .from_df (data )
62
68
max_val = data .sum (axis = 1 ).max ()
63
69
print (cols , symbol , max_val )
You can’t perform that action at this time.
0 commit comments