 x               = d3.scale.linear().domain([0, xMax]).range([0, maxBarWidth])
 xBarLabel       = (d) -> x d.points
 
-toggle = (ytd) ->
-  resource = if ytd then "rankings_ytd" else "rankings"
-  loadData resource, (rankings) -> showChart rankings
-
 initChart = ->
   # svg container element
   chart = d3.select("#rankings-chart")

        type: "checkbox"
        name: "ytd"
        value: "true"
        click: -> toggle($(this).is(':checked'))
      ]
      [ 'label'
        for: "ytd"

    .attr('id', 'barsContainer')
    .attr("transform", "translate(" + barLabelWidth + "," + (gridLabelHeight + gridChartOffset) + ")")

showChart = (data) ->
  labels = d3.select("#labelsContainer").selectAll("text").data(data, (d) -> d.first + d.last)

  # Update transitions
