Refactored chart library to customise easier