我在highcharts-vue
项目中使用了vue
包装器。除了我无法使用viewFullscreen
选项这一事实之外,其他事情进展顺利。
我已经按照docs进行了设置,并将以下内容纳入了main.js
import exportingInit from 'highcharts/modules/exporting'`
exportingInit(Highcharts);
导出功能在我的图表中起作用。对于每个图表,我都设置了以下选项:
exporting: {
buttons: {
contextButton: {
menuItems: ['viewFullScreen', 'downloadPNG', 'downloadJPEG', 'downloadPDF']
}
}
}
除了viewFullscreen
按钮以外,所有按钮均可见且可用。那没有显示。
在highcharts
api
之后的docs之后,并没有提到必须包含额外的选项,以便利用vieFullscreen
模式。
对此有何想法?
答案 0 :(得分:2)
您需要将第一个字符串从viewFullScreen
更改为viewFullscreen
:
exporting: {
buttons: {
contextButton: {
menuItems: ['viewFullscreen', 'downloadPNG', 'downloadJPEG', 'downloadPDF']
}
}
}
实时演示: http://jsfiddle.net/BlackLabel/ekr2mw7f/
API参考: https://api.highcharts.com/highcharts/exporting.buttons.contextButton.menuItems