Move index to templates directory
Fix bug visualizing chart