Refactor for gradientChart.