 
   return maxValues
 
-@drawTeamProgressionGraph = (selector) ->
+progressionDataToPoints = (data, bucketWindow, dataPoints) ->
+      buckets = timestampsToBuckets data, "time", bucketWindow
+      steps = maxValuesFromBucketsExtended buckets, "score"
+
+      if steps.length < dataPoints
+        return steps
+
+      return _.rest(steps, steps.length - dataPoints)
+
+@drawTeamProgressionGraph = (selector, points) ->
   div = divFromSelector selector
   apiCall "GET", "/api/stats/team/score_progression", {}
   .done (data) ->
-    graphData = [["Time", "Score"]]
-    
-    lastSubmission = null
-    _.each data.data, (submission) ->
-      if lastSubmission
-        graphData.push [submission.time - 1, lastSubmission.score]
-      graphData.push [submission.time, submission.score]
-      lastSubmission = submission
+    if data.data.length > 0
+
+      graphData = [
+        ["Time", "Score", {role: "tooltip"}]
+      ]
       
-    packagedData = google.visualization.arrayToDataTable graphData
+      steps = progressionDataToPoints data.data, 600, 30
+      
+      (graphData.push(["", score, score]) for score in steps)
 
-    chart = new google.visualization.LineChart(div)
-    chart.draw(packagedData, teamGraphOptions)
+      console.log graphData
 
+      packagedData = google.visualization.arrayToDataTable graphData
+
+      chart = new google.visualization.SteppedAreaChart(div)
+      chart.draw(packagedData, teamGraphOptions)
+


  return _.extend continuousBucket, buckets

maxValuesFromBuckets = (buckets, sampleKey) ->
  maxValues = []
  
  lastInsertedValue = 0
  _.each buckets, (samples) ->
    values = _.pluck(samples, sampleKey)


  title: "Team Score Progression",
  legend: {
    position: "none"
  },
  vAxis: {
    title: "Score"
  },
  hAxis: {
    ticks: []
  },
  pointSize: 3
}
