无法使用全屏按钮来使用highcharts-vue

时间:2019-05-09 19:43:39

标签: vue.js highcharts

我在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模式。

对此有何想法?

1 个答案:

答案 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