简体   繁体   English

HighCharts图表导出(屏幕截图下载)不显示导航器图形

[英]HighCharts chart export (screenshot download) does not display Navigator graph

We are currently on HighCharts 4.2.2 我们目前正在使用HighCharts 4.2.2

http://api.highcharts.com/highcharts/exporting http://api.highcharts.com/highcharts/exporting

So while reading their exporting docs, I decided instead of using their default menu dropdown. 因此,在阅读他们的导出文档时,我决定不使用默认菜单下拉列表。 I just needed access to the .exportChart() function. 我只需要访问.exportChart()函数。

So what I do is once the chart is done rendering data, I store the chart object into a Factory. 所以我做的是一旦图表完成渲染数据,我将图表对象存储到工厂中。

When I click on a button in another component (chartHeaderComponent) to actually download the screenshot I simple retrieve the stored chart object and call exportChart on it. 当我点击另一个组件(chartHeaderComponent)中的按钮来实际下载屏幕截图时,我只需检索存储的图表对象并在其上调用exportChart

HighChartsComponent HighChartsComponent

return priceLine
    .then(alertSeries)
    .then(tagLine)
    .then(renderChart(chart))
    .then((chart) => {
        ChartExport.setScreenshot(chart);
        this.chartLoading = false;
        return chart;
    });

ChartHeaderComponent ChartHeaderComponent

this.screenshotChart = () => ChartExport.getScreenshot().exportChart();

This will download the chart for me, however the Navigator data is missing :( 这将为我下载图表,但导航器数据丢失:(

First screenshot is what I see in our app: 第一个截图是我在我们的应用程序中看到的:

在此输入图像描述

2nd screenshot is what I see after downloading the screenshot. 第二个屏幕截图是我在下载截图后看到的内容。

在此输入图像描述

I could post details about the chart object here, but it's huge so if anyone can tell me a specific key they need to see I can post it here. 我可以在这里发布关于图表对象的详细信息,但它很大,所以如果有人能告诉我他们需要的特定密钥,我可以在这里发布。

Any help or tips are highly appreciated! 任何帮助或提示都非常感谢! :D :d

Or at least thoughts on how to hide the Navigator from the Screenshot feature. 或至少考虑如何从屏幕截图功能隐藏导航器。

To hide a navigator on exporting, you need to set exporting.chartOptions.navigator.enabled to false. 要在导出时隐藏导航器,需要将exporting.chartOptions.navigator.enabled设置为false。

exporting: {
        chartOptions: {
          navigator: {
            enabled: false
          },
          scrollbar: {
            enabled: false
          }
        }
    }

example: http://jsfiddle.net/yc1yptos/ 示例: http//jsfiddle.net/yc1yptos/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM