AmCharts 4-使用API​​时如何设置导出名称?

时间:2018-11-07 11:55:05

标签: amcharts

我有这个:

this.config = {};
this.chartId = 'myId';
this.chartType = am4charts.PieChart;

this.chart = am4core.createFromConfig(
  {
    this.config,
    this.chartId,
    this.chartType
  }
);

然后做:

this.chart.exporting.export('png');

默认情况下,导出文件的名称设置为“ amCharts.png”。如何将名称设置为其他名称?

我尝试了以下操作但未成功:

this.config = { export: { fileName: 'yay' } };
this.config = { fileName: 'yay' };

1 个答案:

答案 0 :(得分:2)

嗯,事实证明它很简单:

this.chart.exporting.filePrefix = 'yay;
this.chart.exporting.export('png');