user10820654
user10820654

Reputation: 3

Reload amchart upon AJAX response

guys. I need your help to resolve following problem: I have single page web app with amcharts on it. When I update backend data (and receive up-to-date JSON data from server), I can update entire page content except for the amcharts that should also rely on that new data. Is there a way, I could get those amcharts up-to-date upon AJAX-response? I came across that topic and that one, but none of them seem to solve my problem.

Upvotes: 0

Views: 1276

Answers (1)

user3307073
user3307073

Reputation:

You may simply delete outdated charts by emptying contents of the node encompassing them and create charts anew:

var refreshAmcharts = function(chartName, chartData){
        $('.amchartContainer').empty();
        AmCharts.makeChart(chartName, chartData);
    }

Upvotes: 2

Related Questions