Reduce number of files by using javascript

These new files can completely replace the functionality of all chart-*.[html|js] files.