added determineGraphType