 ready = ->
   chart = null
-
   supertabs = $(".super-tab-wrapper")
 
   # On click toggle classes

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

    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)
