Added different colors for the charts.
Refactored the code.