       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])

ready = ->
  chart = null

  supertabs = $(".super-tab-wrapper")

  # On click toggle classes

    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)
