refactoring 'drawSetup' method in chart.draw