[英]Highcharts exporting SVG with data pre-selected
这是我的想法,如何使用exporting.menuItemDefinition功能来实现它。
customSVGExport1
,创建具有将标志更改为 true 并触发 SVG 下载(并再次绘制图表)的功能的自定义导出菜单按钮,
onclick: function() { customSVGExport1 = true; this.exportChart({ type: 'image/svg+xml' }); },
下面 function 将被触发:
chart: { events: { render() { let chart = this; if (customSVGExport1) { // Trigger point hover event chart.series[0].nodes[0].onMouseOver(); // Hide tooltip for export chart.tooltip.label.hide(); // Set flag back to false; customSVGExport = false; } else if (customSVGExport2) { chart.series[0].nodes[1].onMouseOver(); chart.tooltip.label.hide(); customSVGExport = false; } } } },
演示: https://jsfiddle.net/BlackLabel/x67jwsmo/
API: https://api.highcharts.com/highcharts/exporting.menuItemDefinitions
API: https://api.highcharts.com/highcharts/chart.events.render
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.