     @$el.html @vizWindow(elemId: @link.id, content: windowContent)
 
   renderLegend: (graphEl) ->
-    textY = 30
+    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', '20px').
+      style('font-size', "#{titleFontSize}px").
       text('Legend')
 
     _.each @typeOrder.get('vehicle_type'), (vtype, idx) =>

          attr('class', "vehicle-graph-#{i}").
          attr 'height', (d) =>
            maxHeight = yScale(Math.max(2*stdDevAdd, 2*stdDevMult*d))
            topY = topYVal(height, yScale, d, @demand) + padding - 2
            if maxHeight > height - topY + padding - 10
              height - topY + padding - 10
            else
              # Enforce coloring even if stddev. not present to distinguish
              # vehicle types

      graphEl.append('svg:text').
        attr('x', legendTitleWidth + legendLabelWidth*idx).
        attr('y', textY).
        style('font-size', "#{labelFontSize}px").
        style('background-color', vehicleTypeColors[idx]).
        text(name)

      graphEl.append('svg:rect').
        attr('id', "legend-#{idx}").
        attr('x', titleWidth + legendLabelWidth*idx).
        attr('y', 10).
        attr('width', legendLabelWidth).
        attr('height', textY).
        attr('opacity', '0.4').
        attr('enabled', true).
        attr('fill', vehicleTypeColors[idx]).
