How to Refresh Chart on Button Click Without Reloading the Entire Page
-
Dear Developer,
I am using the Easy Charts plugin and need assistance with dynamically refreshing a chart when a user clicks a button, without reloading the entire page.
Here is my goal:
- To update or refresh the chart generated by the
[easy_chart chart_id=...]
shortcode when the user interacts with a button. - Ensure that the chart updates properly, including rendering its full HTML structure and initializing the necessary JavaScript (e.g., via the
uvCharts
library).
I have tried the following approaches:
- Using
do_shortcode
with AJAX to dynamically fetch and insert the chart’s HTML, but the chart does not display correctly after insertion, likely because the required JavaScript is not re-initialized.
Could you please provide guidance or a recommended way to achieve this? Specifically, how can I dynamically refresh or reload a chart without refreshing the entire page?
Thank you for your assistance!
- To update or refresh the chart generated by the
- You must be logged in to reply to this topic.