   render_game canvas, bugs
 
   if bugs.turns % 10 == 0
-    stats = bugs.names.map((name) -> bugs.stats[name])
-    make_chart '#jitterbug_progress_chart_svg', stats, bugs.max_turns, bugs.count
+    stats  = bugs.names.map((name) -> bugs.stats[name])
+    colors = bugs.color_scale.map((color) -> color.rgb)
+    make_chart '#jitterbug_progress_chart_svg', stats,
+                bugs.max_turns, bugs.count, colors
 
   if bugs.turns < bugs.max_turns
     bugs.turns += 1
     setTimeout((-> next_turn bugs, canvas), 50)
 
-starting_bugs = (bug_size, width, height, max_turns) ->
+starting_bugs = (bug_size, width, height, max_turns, color_scale) ->
   grid = []
 
   for x in [0..(width - 1)]


  fabric.Object.prototype.transparentCorners = false

  width     = 60 # Number of bugs
  height    = 40 # Number of bugs
  bug_size  = 10 # pixels
  max_turns = 1000

  canvas.setHeight height * bug_size
  canvas.setWidth  width  * bug_size

  bugs  = starting_bugs(bug_size, width, height, max_turns)
  render_game canvas, bugs

  next_turn bugs, canvas

make_chart = (svg_id, bug_stats, max_turns, max_bugs, colors) ->
  $(svg_id).empty()

  xScale     = new Plottable.Scale.Linear().domain([0, max_turns])
  yScale     = new Plottable.Scale.Linear().domain([0, max_bugs])
  colorScale = new Plottable.Scale.Color().range(colors)

  xAxis  = new Plottable.Axis.Numeric(xScale, "bottom")
  yAxis  = new Plottable.Axis.Numeric(yScale, "left")
