$("#ddlProjeto").change(function () {
var urlPage = window.location.href + "/CarregaDadosGraficoRelatorio";
var nrseq = $("#ddlProjeto").val();
$.ajax({
type: "POST",
url: urlPage,
contentType: "application/json; charset=utf-8",
dataType: "json",
data: JSON.stringify({ nrseq: nrseq }),
async: true,
success: function (result) {
varCriticidadeVulnerabilidade = JSON.parse(result.d);
configuracao = carregaConfiguracaoGraficoItem35();
chart = AmCharts.makeChart("chartdiv", configuracao); //works fine
chart["export"].capture({}, function () { // do not work
// SAVE TO PNG
this.toPNG({}, function (base64) {
// We have now a Base64-encoded image data
// which we can now transfer to server via AJAX
// i.e. jQuery.post( "saveimage.php", { "data": base64 } )
console.log(base64);
});
});
}
})
})
});`
I need to implement this: https://www.amcharts.com/kbase/get-base64-representation-chart-image/
Unfortunelly an error appers when chart["export"].capture is executed,
"Uncaught TypeError: chart.export.capture is not a function"
Below is my javascript code:
`var varCriticidadeVulnerabilidade = undefined; var chart = undefined; function carregaConfiguracaoGraficoItem35() { configuracao = { "type": "serial", "dataProvider": varCriticidadeVulnerabilidade,
`$(document).ready(function () {
Can you help me?