Modified chart.py to write to one html template