Bar chart implementation. Refactoring.