如何自定义“下载CSV"HighCharts中的功能? [英] How to customize "Download CSV" functionality in HighCharts?

查看:73
本文介绍了如何自定义“下载CSV"HighCharts中的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,当我们使用下载CSV"按钮下载报告时,我们只会获得与创建图表时所使用的相同的通用数据.但是,如果我想同时下载更多数据,该如何实现呢?

by default when we use "Download CSV" button to download report, we just get the same common data which were used while creating chart. But if I want to download more data along with those then how to achieve that?

推荐答案

我们可以通过将新项添加到菜单中来实现相同目的:

We can achieve the same by adding the new item to the menu like this:

Highcharts.getOptions().exporting.buttons.contextButton.menuItems.push({
    text: 'Download custom CSV',
    onclick: function () {
       /* Add your custom logic to download CSV file with desired data*/
    }
});

这篇关于如何自定义“下载CSV"HighCharts中的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆