fix: simplify controller code for the chart.