Refactor/fix chart toggle