title: Bokeh Candlestick Chart with OHLCV values as tooltip or/and lable
body: <p>How do you get a tool tip on Bokeh candlestick chart like this:</p>
  <p><a href="https://i.stack.imgur.com/LqzDc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LqzDc.png" alt="Tooltip on Candle Bar" /></a></p>
  <p>or/and a lable like this:</p>
  <p><a href="https://i.stack.imgur.com/wXBVq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wXBVq.png" alt="Bar Information Labels" /></a></p>
  <hr />
  <p>The code I have so far for drawing the chart is as follows:</p>
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import numpy as  np
  from bokeh.plotting import figure, output_notebook, show
  from bokeh.models import LinearAxis, Range1d, Segment, Legend
  from bokeh.models.formatters import NumeralTickFormatter, DatetimeTickFormatter
  from bokeh.palettes import Category20
  output_notebook()
  
  def init_chart(name):
    # Tools Selections:
    TOOLS = &quot;pan,xwheel_zoom,box_zoom,crosshair,undo,redo,reset,save&quot;
  
    p = figure(x_axis_type=&quot;datetime&quot;, tools=TOOLS, 
               title = name)
    p.add_layout(Legend(click_policy=&quot;hide&quot;, orientation='horizontal', spacing=20), 'below')
    p.sizing_mode = 'scale_both'
  
    return p
  
  def init_price_volume_chart(p, df):
    RED = Category20[7][6]
    GREEN = Category20[5][4]
  
    inc = df.Close &gt; df.Open
    dec = df.Open &gt; df.Close
    w = 12*60*60*1000 # half day in ms
  
    p.x_range = Range1d(df.index[0], df.index[-1])
    p.xaxis[0].formatter = DatetimeTickFormatter(months=&quot;%b %Y&quot;, days=&quot;%d %b %Y&quot;)
    p.xaxis.axis_label = 'Date'
    p.xaxis.major_label_orientation = 3.1415/4
    p.xaxis.ticker.desired_num_ticks = 40
  
    # left y axis
    low, high  = df.Low.min(), df.High.max()
    p.y_range = Range1d(low * 0.9, high * 1.1)
    p.yaxis.axis_label = 'Price'
    p.yaxis[0].formatter = NumeralTickFormatter(format=&quot;0,0.00&quot;)
    p.segment(df.index, df.High, df.index, df.Low, color=GREEN, legend_label='Candlestick')
    p.vbar(df.index[inc], w, df.Open[inc], df.Close[inc], 
          fill_color=GREEN, line_color=GREEN, legend_label='Candlestick')
    p.vbar(df.index[dec], w, df.Open[dec], df.Close[dec], 
          fill_color=RED, line_color=RED, legend_label='Candlestick')
  
    # right y axis
    p.extra_y_ranges.update({'two':  Range1d(0, 1.1*df.Volume.max())})
    p.add_layout(LinearAxis(y_range_name='two', axis_label='Volume' ), 'right')
    p.yaxis[1].formatter = NumeralTickFormatter(format=&quot;0a&quot;)
    p.vbar(df.index[inc], w, df.Volume[inc], [0]*inc.sum(), alpha=0.5, level='underlay', 
          fill_color=GREEN, line_color=GREEN,
          legend_label='Volume', y_range_name='two')
    p.vbar(df.index[dec], w, df.Volume[dec], [0]*dec.sum(), alpha=0.5, level='underlay', 
          fill_color=RED, line_color=RED,
          legend_label='Volume', y_range_name='two')
    
    return p
  </code></pre>