           s.owner = holder_id
           new_chart.series.add(s)
 
+        # if the chart was pinned as table let's set the instance variable
+        show_as_table = App.settings.get('charts')[holder_id].format == 'table'
+        if show_as_table
+          new_chart.view.display_as_table = true
+
         # Now it's time to upate the buttons and links for the chart
         root = $('#' + holder_id).parents('.chart_holder')
+
         # show/hide default chart button - only for the chart holders that
         # actually define a default chart. The dashboard popups charts don't.
         if container_info = App.settings.get('charts')[holder_id]
           default_chart_for_holder = container_info.default
           root.find("a.default_chart").toggle(chart_id != default_chart_for_holder)
+
         # show/hide format toggle button
-        root.find("a.table_format").toggle( new_chart.view.can_be_shown_as_table() )
-        root.find("a.chart_format").hide()
+        root.find("a.chart_format, a.table_format").hide()
+        if show_as_table && new_chart.can_be_shown_as_table()
+          root.find("a.chart_format").show()
+        if new_chart.can_be_shown_as_table() && !show_as_table
+          root.find("a.table_format").show()
+
         # update chart information link
         root.find(".actions a.chart_info").attr(
           "href", "/descriptions/charts/#{chart_id}")

  #    to show multiple charts on the same page
  #  - alternate: id of the chart to load if the first one fails. Watch out for
  #    loops!
  load : (chart_id, holder_id = 'main_chart', options = {}) =>
    if @pinned_chart_in(holder_id) || @current_chart_in(holder_id) == chart_id
      return false


  shown_as_table: => @view.display_as_table

  can_be_shown_as_table: => @view.can_be_shown_as_table()

class @ChartList extends Backbone.Collection
  model : Chart

