added ng-switch to detect graphs