Insert chart function into generate_index_html().