   return s
 
 
-prepareChart = ->
+prepareChart = (numberOfPositions) ->
   $chart = $('#chart')
   $chart.highcharts 'StockChart',
     chart:

    for item, count of topitems
      items[item][timestamp] = count

  chart = prepareChart()
  # Limit timeframe to last half.
  if timeframe != 'overall'
    timestamps = timestamps[-timestamps.length // 2 .. -1]

  for item, weeks of items
    series =
      name: item

               #{ Highcharts.dateFormat('%A, %b %e, %Y', @x) }
             </span>"
        points = _.sortBy(@points, (point) -> point.y)
        for point, index in points[-numberOfPositions..]
          strIndex = zfill(numberOfPositions - index, 2)
          if point.y > 0
            s += "<br/>#{ strIndex }
                  <span style=\"color: #{ point.series.color };\"> ● </span>"
