New code for charts.