Fixed the chart creation.