Break chart.render() into smaller functions.
Break chart.render() into smaller functions.