Json data for the charts in generate_html, needs refactoring