fix create_chart to work with new templates page,div, and script