Skip to content

Instantly share code, notes, and snippets.

@Kirkman
Created September 11, 2023 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kirkman/248c0a818609c5069bb557483c20778a to your computer and use it in GitHub Desktop.
Save Kirkman/248c0a818609c5069bb557483c20778a to your computer and use it in GitHub Desktop.
Chart Tool update/redraw on page load
window.addEventListener("load", function() {
document.querySelectorAll('.ct-chart').forEach(this_chart => {
let this_id = this_chart.getAttribute('data-chartid');
const obj = ChartTool.read(this_id);
this_id = this_id.replace('ct-','');
ChartTool.update(this_id,obj.data);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment