I have a D3 chart that I have deployed as an HTML page and I want to refresh this page from a button
D3
HTML
button
When I click the button the page does not refresh and the chart disappears
If I manually refresh the page the chart returns. You can see this here:
chart
https://script.google.com/macros/s/AKfycbwaU-Pd6Q9sLmW_xXRQ31m1BsFIJlwYR9yGD6Lk0MYEHxMj294jujE/exec
I have
<!DOCTYPE html> <meta charset="utf-8"> <!-- styles --> <html> <head> <?!= HtmlService.createHtmlOutputFromFile("styles.css").getContent(); ?> </head> <body> <div class="content"> <h1>d3 chart powered by data from Google Sheet</h1> <input type="button" value="Reload Page" onClick="document.location.reload(true)"><br> </div> <svg class="chart" width = "500" height = "500"></svg> <!-- javascript --> <script type="text/javascript" src="https://d3js.org/d3.v4.min.js"></script> <?!= HtmlService.createHtmlOutputFromFile("chart.js").getContent() ?> <?!= HtmlService.createHtmlOutputFromFile("main.js").getContent() ?> </body> </html>
1.4m articles
1.4m replys
5 comments
57.0k users