               date: new Date(""+attr)
               value: +d.data[attr]
 
-          selectedData =
-            date: state.selMagnAttr()
-            value: d.data[state.selMagnAttr()]
-
-          createTimeSeries(d3.select("#sparkline"), data, selectedData)
+
+          createTimeSeries(d3.select("#sparkline"), data)
 
           $(tipsy.$tip)
               .css('top', event.pageY-($(tipsy.$tip).outerHeight()/2))

    .append("g")
      .attr("transform", "translate(" + margin.left + "," + margin.top + ")")

  spark.append("rect")
    .attr("class", "background")
    .attr("x", 0)
    .attr("y", 0)
    .attr("width", w)
    .attr("height", h)

  spark.append("g")
    .attr("class", "y axis")
    .call(yAxis)

  spark.append("g")
    .attr("class", "x axis")
    .attr("transform", "translate(0," + h + ")")
    .call(xAxis)


  spark
    .append("path")
    .attr("class", "line")
    .attr("d", line)

  spark.append("circle")
    .attr("class","selAttrValue")
    .attr("cx", x(new Date(""+selectedData.date)))
    .attr("cy", y(+selectedData.value))
    .attr("r", 2)



mapProjPath = d3.geo.path().projection(mapProj)


createTimeSeries = (parent, data) ->
  margin = {top: 15, right: 3, bottom: 14, left: 40}
  w = 200 - margin.left - margin.right
  h = 100 - margin.top - margin.bottom
