This code seems a little boilerplate. I think what we want is an angular select like https://github.com/angular-ui/ui-select - ng-model would be set to panel.display.display_type, and the panel chart would change automatically when the model changes - instead of creating a changeDisplayType function, changing the label of the button, etc. But I'm fine with leaving it as is for now.