Hi,
I want to add hover to my candlestick. How can I add?
from math import pi
import pandas as pd
import numpy as np
Load bokeh modules
functions for creating outputs
from bokeh.io import output_file, show, output_notebook
figure creating library
from bokeh.plotting import figure
from bokeh.plotting import figure, output_file, show
Interactivity tools
from bokeh.models import HoverTool
df=stock_data2
output_notebook()
from bokeh.plotting import figure, output_file, show
#df.reset_index(inplace=True)
df[“Date”] = pd.to_datetime(df[“Date”])
inc = df.Close > df.Open
dec = df.Open> df.Close
w = 126060*1000 # half day in ms
TOOLS = “pan,wheel_zoom,box_zoom,reset,save,hover”
#p = p.select(dict(type=HoverTool))
p = figure(x_axis_type=“datetime”, tools=TOOLS, plot_width=1000, title = “GOOGLE Candlestick”)
p.xaxis.major_label_orientation = pi/4
p.grid.grid_line_alpha=0.3
p.segment(df.Date, df.High, df.Date, df.Low,color=“black”)
#df.Open[inc]
#df.Date[dec]
p.vbar(df.Date[inc], w, df.Open[inc], df.Close[inc], fill_color="#D5E1DD", line_color=“black”)
p.vbar(df.Date[dec], w, df.Open[dec], df.Close[dec], fill_color="#F2583E", line_color=“black”)
#df.Open[“IBM”]
show(p) # open a browser