I am making a dashboard reporting tool that loads multiple charts on the selection of some filters. I use Ajax
to load the charts and use Ajaxload to have a small circle as a waiting symbol. Something like:
I want to combine all those circles into one circle in the center, like any normal ecommerce website. The ajax code is below:
$.ajax({
type: "POST",
data: {
"jsontring": JSON.stringify(output)
},
url: "http://localhost:8080/sales",
contentType: "application/json",
dataType: "json",
cache: false,
beforeSend: function () {
$('#container').html("<img class = 'ajload' src='loading.gif' />");
$('#container1').html("<img class = 'ajload' src='loading.gif' />");
},
success: function (data) {
datavol = data.Vol
dataval = data.Val
$('#container').highcharts(datavol);
$('#container1').highcharts(dataval);
},
error: function () {
alert("Sales Issue!")
},
});
$.ajax({
type: "POST",
url: "http://localhost:8080/soc",
data: {
"jsontring": JSON.stringify(output)
},
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false,
beforeSend: function () {
$('#container3').html("<img class = 'ajload' src='loading.gif' />");
$('#container4').html("<img class = 'ajload' src='loading.gif' />");
},
success: function (data) {
datavol = data.Vol
dataval = data.Val
$('#container3').highcharts(datavol);
$('#container4').highcharts(dataval);
},
error: function () {
alert("Soc Issue")
},
});
$.ajax({
type: "POST",
url: "http://localhost:8080/marketshares",
data: {
"jsontring": JSON.stringify(output)
},
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false,
beforeSend: function () {
$('#marketshares').html("<img class = 'ajload' src='loading.gif' />");
$('#marketshares1').html("<img class = 'ajload' src='loading.gif' />");
},
success: function (data) {
datavol = data.Vol
dataval = data.Val
$('#marketshares').highcharts(datavol);
$('#marketshares1').highcharts(dataval);
},
error: function () {
alert("MarketShares Issues")
},
});
Is there any specific fucnctiuon for this?