         .attr('class', 'target')
 
     target.append("path")
-        .attr('class', 'line')
+        .attr('class', line_mode)
         .attr('stroke', (d, i) -> color i)
-        .style('stroke-width', params.lineWidth)
-        .attr('d', (d) -> line(d.values))
+        .style('stroke-width', (d, i) -> params.lineWidth)
+        .style('stroke-opacity', line_opacity)
+        .attr('fill', (d, i) -> if line_mode(d, i) is 'area' then color i)
+        .style('fill-opacity', area_opacity)
+        .attr('d', (d, i) -> line_fn(d, i)(d.values))
 
     legend = d3.select(container).append('ul')
         .attr('class', 'legend')

        value_max = Math.max value, value_max
        {value, time: moment(timestamp * 1000)}
      {values, name: s.target}

    time_min = moment(time_min * 1000)
    time_max = moment(time_max * 1000)

    y_axis = d3.svg.axis().scale(y).orient('left')
    color = d3.scale.category10()

    area_opacity = params.areaAlpha ? 1.0
    line_opacity = 1.0

    area = d3.svg.area()
      .x((d) -> x d.time)
      .y0((d) -> y d.y0 ? 0)
      .y1((d) -> y d.value + (d.y0 ? 0))
      .defined((d) -> d.value?)

    line = d3.svg.line()
      .x((d) -> x d.time)
      .y((d) -> y d.value)
      .defined((d) -> d.value?)

    line_mode = (d, i) ->
      if params.areaMode is 'all' or params.areaMode is 'stacked'
        'area'
      else if params.areaMode is 'first' and i is 0
        'area'
      else
        'line'

    stack = d3.layout.stack()
      .values((d) -> d.values)
      .x((d) -> d.time)
      .y((d) -> d.value)
      .out((d, y0) -> d.y0 = y0)

    line_fn = (d, i) ->
      mode = line_mode d, i
      if mode is 'line'
        line
      else
        area

    transform_value =
      if params.drawNullAsZero
