如何在 HighCharts 中自定义 "Download CSV" 功能?
How to customize "Download CSV" functionality in HighCharts?
默认情况下,当我们使用 "Download CSV" 按钮下载报告时,我们只会获得与创建图表时使用的相同的公共数据。但是如果我想下载更多数据以及那些数据那么如何实现呢?
我们可以通过将新项目添加到菜单来实现相同的效果:
Highcharts.getOptions().exporting.buttons.contextButton.menuItems.push({
text: 'Download custom CSV',
onclick: function () {
/* Add your custom logic to download CSV file with desired data*/
}
});
默认情况下,当我们使用 "Download CSV" 按钮下载报告时,我们只会获得与创建图表时使用的相同的公共数据。但是如果我想下载更多数据以及那些数据那么如何实现呢?
我们可以通过将新项目添加到菜单来实现相同的效果:
Highcharts.getOptions().exporting.buttons.contextButton.menuItems.push({
text: 'Download custom CSV',
onclick: function () {
/* Add your custom logic to download CSV file with desired data*/
}
});