amcharts - AmCharts 4 - 使用 API 时如何设置导出的名称?
问题描述
我有这个:
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' };
解决方案
好吧,事实证明很简单:
this.chart.exporting.filePrefix = 'yay';
this.chart.exporting.export('png');
推荐阅读
- amazon-web-services - WSL2 中的 AWS CLI:“RequestTimeTooSkewed”
- amazon-web-services - 在云形成中将文件传递给 ec2
- php - Laravel 查询哪个性能更高
- python - KMeans 聚类:将结果添加到初始数据集
- php - codeigniter 框架中的 @ 是什么?
- python - 有时在我使用 Python 3.9.5 和 Apache 2.4 在 windows10 家庭添加上部署 Django 应用程序后引发 ValueError
- powershell - Microsoft graph powershell - 无法添加许可证
- binance - CCXT 币安 fetch_ohlcv 函数
- c++ - boost::asio::connect 在错误的子网上报告成功
- verilog - 错误:合成不支持在多个单边下分配