Refactoring. Fixed chart legend