Amcharts displays data only when resized

I have a really weird error when using AmCharts preview on twitter bootstrap modal.
It’s actually modal, which is used to preview some graph data, but in fact it doesn’t show graphs sometimes until:

-I open the item verification dialog box. (means window resize event)
-Or by changing the inspection item dialog box if it is already open. (Again means a window resize event)
-I manually resize the browser window

From the point of view of my backend, there is no problem sending data, it always sends the same data.

I know that my problem is really stupid, but I think maybe someone can happen to this.
thanks in advance

+4
source share
3 answers

had the same problem fixed by resizing after modal display

$('#myModal').on('shown.bs.modal', function (e) {
chart.invalidateNow();
chart.validateSize();
}
+1
source

I had a problem too, so try this for me:

 $('#myModal').on('shown.bs.modal', function (e) {
           chart.validateData();
           chart.animateAgain();
 });

In fact, you can simply add chart.animateAgain();on shown.bs.modalto redraw the chart.

0
source

Other solutions did not help me. For me, this did the trick:

chart.invalidateSize();
0
source

All Articles