如何将highcharts系列图的颜色下载为黑白作为图像下载?

问题描述 投票:2回答:2
I was trying to download the highcharts.js line graph in the black and white image during downloading in spite of the colors which are randomly generated in the graph. But I am not getting how can I achieve this. 

以下是图表的链接。

https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/line-basic/

I want the graph to be black and white during downloading only and I want them to stay colorful during the rendering. Right now it is downloading as a colorful image. 

Thanks in advance because I am a novice in the highcharts. I am stuck in this position. Please help me out.
javascript reactjs highcharts
2个回答
0
投票

使用导出选项将默认颜色更改为黑色:

exporting: {
        chartOptions: {
            colors: ['#000000', '#000000', '#000000', '#000000', '#000000'],
        }
    },

这是一个demo


0
投票

您可以通过chartOptions属性更改导出的颜色:

exporting: {
    chartOptions: {
        ...
    }
}

现场演示:http://jsfiddle.net/BlackLabel/8typuasx/

API参考:https://api.highcharts.com/highcharts/exporting.chartOptions

© www.soinside.com 2019 - 2024. All rights reserved.