 $ ->
-  if gon.raw_run isnt `undefined`
+  if gon.run.raw_splits?
+    colors_obj = {}
+    $(".timeline").children(".split").each (index) ->
+      color = $(this).css("background-color")
+      return if color is "rgba(0, 0, 0, 0)"
+      colors_obj[$(this).children()[0].innerHTML] = color
+    default_color = $(".timeline").children(".split").first().css("background-color")
+
+
     pb_graph_data = ["PB - Gold"]
     pb_graph_ticks = []
     $.each gon.run.splits, (i, split) ->
-      time = split.duration - split.best
-      if time > 5
-        pb_graph_data.push d3.round(time, 2)
-        pb_graph_ticks.push split.name
+      time = d3.round(split.duration - split.best, 2)
+      return if time <= 0
+      pb_graph_data.push time
+      pb_graph_ticks.push split.name
     pb_graph = c3.generate({
       bindto: "#pb-graph",
       title: { text: "PB vs Golds" },
       data: {
         columns: [pb_graph_data],
-        type: "bar"
+        type: "bar",
+        color: (color, d) -> return default_color
       },
       axis: {
         x: {

      legend: { hide: true }
    })

    duration_data = gon.raw_run.history.map((time) -> return time)
    duration_data.unshift "Run Length"
    c3.generate({
      bindto: "#run-duration-graph",
      title: { text: "Run Duration Over Time" }
      data: { columns: [duration_data] },
      axis: {
        x: {
          tick: {
            culling: false
          }
        },
        y: {



    seg_histories = []
    $.each gon.run.raw_splits, (i, split) ->
      seg_histories.push JSON.parse(JSON.stringify(split.history))
      seg_histories[i].unshift split.name
    c3.generate({
      bindto: "#segment-duration-graph",
      title: { text: "Segment Histories Over Time"},
      data: {
        columns: seg_histories,
        color: (color, d) -> return if d.id then colors_obj[d.id] else colors_obj[d]
      }
      axis: {
        x: {
          type: "category",
          categories: index + 1 for split, index in gon.run.history
          tick: {
            culling: true,
            multiline: false
          }
        },
        y: {
