def create_complex(from_graphs, to_complex)
      graph_data = []
      from_graphs.each do |from_graph|
        graph = get_graph(from_graph["service_name"], from_graph["section_name"], from_graph["graph_name"])
        graph_id = graph['id']

        graph_data << {
          :gmode    => from_graph["gmode"],
          :stack    => from_graph["stack"],
          :type     => from_graph["type"],
          :graph_id => graph_id
        }
      end

      post_params = {
        :service_name => to_complex["service_name"],
        :section_name => to_complex["section_name"],
        :graph_name   => to_complex["graph_name"],
        :description  => to_complex["description"],
        :sort         => to_complex["sort"],
        :data         => graph_data
      }
      post_json('/json/create/complex', post_params)
    end
def create_complex(from_graphs, to_complex)
      graph_data = []
      from_graphs.each do |from_graph|
        graph = get_graph(from_graph["service_name"], from_graph["section_name"], from_graph["graph_name"])
        graph_id = graph['id']

        graph_data << {
          :gmode    => from_graph["gmode"],
          :stack    => from_graph["stack"],
          :type     => from_graph["type"],
          :graph_id => graph_id
        }
      end

      post_params = {
        :service_name => to_complex["service_name"],
        :section_name => to_complex["section_name"],
        :graph_name   => to_complex["graph_name"],
        :description  => to_complex["description"],
        :sort         => to_complex["sort"],
        :data         => graph_data
      }
      post_json('/json/create/complex', post_params)
    end
Create a complex graph

 @param [Array] from_graphs Array of graph properties whose keys are
   ["service_name", "section_name", "graph_name", "gmode", "stack", "type"]
 @param [Hash] to_complex Property of Complex Graph, whose keys are like
   ["service_name", "section_name", "graph_name", "description", "sort"]