var xyz = chart.exporting.getImage("png").then(function (imgdata) {
});
The above function xyz is a promising object how to get whether the object is full filled or not
based on the promiseStatus,refer the picture .
After full filled i want to execute the below code
var image = imgdata.replace('data:image/png;base64,', '');
jQuery.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "VATReportGeneration.aspx/SetImageInSession",
data: JSON.stringify({ "image": image }),
dataType: "json",
success: function (data) {
if (data != '') {
jQuery.ajax({
type: 'POST',
cache: false,
url: file,
success: function (data) {
url = '';
url = "../../ReportHandler/VATConfigurationFileHandler.aspx";
file = '';
file = url + "?ReportByte=1";
$get("exporthandler").src = file;
chart.dispose();
document.getElementById('loading').style.display = "none";
//document.getElementById('loading').style.display = "none";
},
error: function (data) {
//document.getElementById('loading').style.display = "none";
}
});
}
}
});
2
Answers
I finally got answer from my colleague by passing a chart object to a callback function from call back function I have converted the chart to 64basestring.
Write your image data
imgdata
handling logic code inside.then
More here: https://www.amcharts.com/docs/v4/concepts/exporting/#Triggering_export