Fixed bug in charts.py