         @html[chart_id] = data.html
         # Add to the Chart constructor options the id of the container element
         data.attributes.container = holder_id
-        # Remember what we were showing in that position
-        old_chart = @chart_holders[holder_id]
         # Create the new Chart
         new_chart = new Chart(data.attributes)
         if !new_chart.supported_by_current_browser()

          "href", "/descriptions/charts/#{chart_id}")
        # show.hide the under_construction notice
        root.find(".chart_not_finished").toggle new_chart.get("under_construction")
        App.call_api() unless wait
    @last()

  # returns the current chart id

            alert I18n.t('output_elements.common.old_browser')
          return false

        # Remember what we were showing in that position
        if old_chart = @chart_holders[holder_id]
          old_chart.delete()
          @remove old_chart

        @chart_holders[holder_id] = new_chart
        @add new_chart
        # Pass the gqueries to the chart
        for s in data.series
