I\'m using d3.json to get a dynamic data.
d3.json(\"/myweb/totalQtyService.do\", function(json) {
drawChart(json);
});
How do I post
If you want to make a request like an HTML form (using query parameters), then you would do:
d3.request("/path/to/resource")
.header("X-Requested-With", "XMLHttpRequest")
.header("Content-Type", "application/x-www-form-urlencoded")
.post("a=2&b=3", callback);
See the docs here: d3-request docs
If you want to convert a simple object to a query parameter string, then you can use the following function:
function obj2Params(params){
var str = "";
var amp = "";
for(var p in params){
if(params.hasOwnProperty(p)) {
str += amp + encodeURIComponent(p) + "=" + encodeURIComponent(params[p]);
amp = "&";
}
}
return str;
}