anchor.diff:              {delete_chart, Id} ->
                   wf:wire("deleteChart(\"" ++ integer_to_list(Id) ++ "\");"),
                   gui_utils:flush(),
  -                ?MODULE:comet_loop(Counter, PageState#page_state{charts = dict:erase(Id, Charts)})
  +                ?MODULE:comet_loop(Counter, PageState#page_state{charts = proplists:delete(Id, Charts)})
   
           end
       catch Type:Msg ->
  
positive.code: -define(HOST_CHART_TYPES, [<<"CPU utilization">>, <<"memory usage">>, <<"network throughput">>, <<"network transfer">>, <<"ports transfer">>]).
  -define(GEN_SERVER_TIMEOUT, 5000).
  
  -record(page_state, {nodes, node, time_range, chart_type, charts = dict:new()}).
  -record(chart, {id, node, time_range, type, update_period}).
  
  -export([main/0, event/1, comet_loop/2]).
  
negative.code:     gui_utils:flush().
  
  
  %% validate_page_state/1
  %% ====================================================================
  %% @doc Checks whether user has selected all requiered options to draw chart.
  -spec validate_page_state(PageState :: #page_state{}) -> ok | error.
  %% ====================================================================
  validate_page_state(#page_state{node = undefined}) ->
      error_message(<<"Please select host.">>),
      error;
  validate_page_state(#page_state{time_range = undefined}) ->
      error_message(<<"Please select time range.">>),
      error;
  validate_page_state(#page_state{chart_type = undefined}) ->
      error_message(<<"Please select chart type.">>),
      error;
  validate_page_state(_) ->
      ok.
  
  
  %% validate_chart/4
  %% ====================================================================
  %% @doc Checks whether chart can be drawn on page. Chart can be drawn
  %% when it is not already available on page.
  -spec validate_chart(Node :: summary | node(), TimeRange :: binary(), ChartType :: binary(), Charts :: [{Key :: integer(), #chart{}}]) -> ok | error.
  %% ====================================================================
  validate_chart(_, _, _, []) ->
      ok;
  validate_chart(Node, TimeRange, ChartType, [{_, #chart{node = Node, time_range = TimeRange, type = ChartType}} | _]) ->
      error;
  validate_chart(Node, TimeRange, ChartType, [_ | Charts]) ->
      validate_chart(Node, TimeRange, ChartType, Charts).
  
  
  %% host_dropdown_body/0
  