anchor.diff:      gui_utils:flush().
   
   
  -%% validate/1
  -%% ====================================================================
  -%% @doc Checks whether user has selected all requiered options to plot chart
  --spec validate(PageState :: #page_state{}) -> ok | error.
  -%% ====================================================================
  -validate(#page_state{node = undefined}) ->
  +%% 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{time_range = undefined}) ->
  +validate_page_state(#page_state{time_range = undefined}) ->
       error_message(<<"Please select time range.">>),
       error;
  -validate(#page_state{chart_type = undefined}) ->
  +validate_page_state(#page_state{chart_type = undefined}) ->
       error_message(<<"Please select chart type.">>),
       error;
  -validate(_) ->
  +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
  
positive.code: %% ====================================================================
  get_json_data(Id, Node, Period, Target, Command, TimeRange, ChartType) ->
      {MegaSecs, Secs, _} = erlang:now(),
      EndTime = trunc(((1000000 * MegaSecs + Secs - Period - 1) / Period) * Period),
      StartTime = EndTime - time_range_to_integer(TimeRange),
      BinaryStartTime = integer_to_binary(StartTime),
      BinaryEndTime = integer_to_binary(EndTime),
  
negative.code:             {delete_chart, Id} ->
                  wf:wire("deleteChart(\"" ++ integer_to_list(Id) ++ "\");"),
                  gui_utils:flush(),
                  ?MODULE:comet_loop(Counter, PageState#page_state{charts = proplists:delete(Id, Charts)})
  
          end
      catch Type:Msg ->
  