javascript - Weird flot behaviour in AJAX calls -


i'm getting weird behaviour when adding flot plots through ajax.

this result: enter image description here

it displays last graph. can confirmed due fact calls asynchronous, , such order of plots random - data being fed flot not issue.

my current code ajax call:

function addgraph(x, y, z){   $.ajax({     datatype: "json",     method: "get",     url: "/api.php",     data: { a: "b", c:$("#d").val(), e: z}   }).done(function( plotdata ){     $("#graph").html($("#graph").html() + y.format(x));     $.plot($("#plot-"+x), plotdata.data, plotdata.options);   }); } 

the y variable string that's formatted through sprintf function , looks this:

<div class="col-md-6" style="height:250px;" id="plot-{0}"></div> 


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -