图表 - 导出文件名的自定义对话框



如何为amchart导出添加通用自定义输入对话框,以便为下载的文件提供自定义文件名,而不考虑格式。

我只需要在实际下载之前单击任何导出选项时提供自定义文件名。

我认为当已经单击导出按钮时,您无法更改文件名。但是,您可以提前更改fileName

// create your chart
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"export": {
"fileName": "any_default_filename"
}
// ...
});
// HTML
<div>Filename: <input type="text" id="fileName"></div>
<div id="chartdiv"></div>
// oninput handler (will set the chart's fileName property)
document.getElementById("fileName").oninput = function(e){
chart.export.fileName = this.value;
chart.validateNow();
}

最新更新