fixing the chart width initialization bug