     line:
       connectNull: true
 
+  # Initialise chart
   initChart = (container) ->
     chart = c3.generate(chartOptions)
 
+  # Custom chart legend
   renderLegend = (data) ->
+    # Append li
     d3.select('.legend').selectAll('li').data(data["legend"])
       .enter().append 'li'
       .attr('class', 'key', 'data-id', (id) -> id)

      t.siblings().addClass("unselected").removeClass("selected")
      t.trigger("selected")

  supertabs.on "selected", (e) ->
    loadChart($(e.target).data("chart-url"), $("#chart-container"))
    loadCards($(e.target).data("details-url"), $("#card-wrapper"))

      columns: data["columns"]
    renderLegend(data)

  # Update chart header on load
  updateChartHeader = (data) =>
    $('#chart-container .chart-header').attr('id', "tab_" + data["title"][1])
    $('#chart-container .chart-header h2').text(data["title"][0])
