       graphEl.append('svg:text').
         attr('x', legendTitleWidth + legendLabelWidth*idx).
         attr('y', textY).
-        style('font-size', '14px').
+        style('font-size', "#{labelFontSize}px").
         style('background-color', vehicleTypeColors[idx]).
         text(name)
 
       graphEl.append('svg:rect').
         attr('id', "legend-#{idx}").
-        attr('x', 100 + legendLabelWidth*idx).
+        attr('x', titleWidth + legendLabelWidth*idx).
         attr('y', 10).
         attr('width', legendLabelWidth).
-        attr('height', 30).
+        attr('height', textY).
         attr('opacity', '0.4').
         attr('enabled', true).
         attr('fill', vehicleTypeColors[idx]).

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


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

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