Improved javascript chart