Fixed a little issue with using old chartData variable