       attr('id', 'legend').
       attr('x', 5).
       attr('y', 5).
-      attr('width', width + padding - 10).
-      attr('height', padding - 12).
+      attr('width', width + padding - labelFontSize).
+      attr('height', padding - labelFontSize - textSizeImprecisionOffset).
       attr('fill', 'white').
       attr('stroke', 'lightGray')
 

            d3.selectAll(".vehicle-graph-#{idx}").style('visibility','visible')

  renderGraph: (sel) ->
    textSizeImprecisionOffset = 2
    labelFontSize = 10
    width = 450
    height = 400
    padding = 50

    @$el.html @vizWindow(elemId: @link.id, content: windowContent)

  renderLegend: (graphEl) ->
    titleFontSize = 20
    titleWidth = titleFontSize * 5
    textY = titleFontSize + 10
    labelFontSize = titleFontSize * 7 / 10
    legendTitleWidth = 100
    legendLabelWidth = 75

    graphEl.append('svg:text').
      attr('x', 10).
      attr('y', textY).
      style('font-size', "#{titleFontSize}px").
      text('Legend')

    _.each @typeOrder.get('vehicle_type'), (vtype, idx) =>
