Refactoring: minor cleanup of ChartBase constructor.
Refactoring: replaced malloc