       ctx.beginPath()
       ctx.rect(@x_shift[i], @y_shift[i], @width[i], @height[i])
 
-      @visuals.fill.set_vectorize(ctx, i)
-      ctx.fill()
+      if @visuals.fill.doit
+        @visuals.fill.set_vectorize(ctx, i)
+        ctx.fill()
 
-      @visuals.line.set_vectorize(ctx, i)
-      ctx.stroke()
+      if @visuals.line.doit
+        @visuals.line.set_vectorize(ctx, i)
+        ctx.stroke()
 
-      @visuals.text.set_vectorize(ctx, i)
-      ctx.fillText(@text[i], 0, 0)
+      if @visuals.text.doit
+        @visuals.text.set_vectorize(ctx, i)
+        ctx.fillText(@text[i], 0, 0)
       ctx.restore()
 
   _css_text: () ->
     ctx = @plot_view.canvas_view.ctx
 
     for i in [0...@text.length]
+      @visuals.text.set_vectorize(ctx, i)
 
-      if @label_div[i].html() == ""
-        @label_div[i].appendTo(@plot_view.$el.find('div.bk-canvas-events'))
+      if not @label_div[i].style?
+        @label_div[i].appendTo(@plot_view.$el.find('div.bk-canvas-overlays')).hide()
 
       @label_div[i]
         .html(@text[i])

      x_shift = -width

    if ctx.textBaseline == 'top'
      y_shift = 0.2 * height
    if ctx.textBaseline == 'middle'
      y_shift = -0.4 * height
    if ctx.textBaseline == 'bottom'
      y_shift = -1.0 * height
    if ctx.textBaseline == 'alphabetic'
      y_shift = -0.8 * height
    if ctx.textBaseline == 'hanging'
      y_shift = -0.025 * height

    return [x_shift, y_shift]

  render: () ->

    @map_data() ##unclear why calling this in init returns NaNs

    if @mget('render_mode') == 'canvas'
      @_canvas_text()
    else

$ = require "jquery"

Annotation = require "./annotation"
ColumnDataSource = require "../sources/column_data_source"
Renderer = require "../renderers/renderer"
p = require "../../core/properties"

class LabelView extends Renderer.View
  initialize: (options) ->
    super(options)
    if not @mget('source')?
      this.mset('source', new ColumnDataSource.Model())
    @set_data()

  bind_bokeh_events: () ->
    if @mget('render_mode') == 'css'
