【问题标题】:How to change the color of highcharts series graph to black & white during downloading it as an image?如何在将highcharts系列图下载为图像时将其颜色更改为黑白?
【发布时间】:2019-04-07 11:51:54
【问题描述】:
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.

【问题讨论】:

  • 到目前为止你有什么尝试?您只是链接了 Highcharts 演示而不是您的代码。
  • 我不知道如何继续这就是为什么我问这个问题@core972。

标签: javascript reactjs highcharts


【解决方案1】:

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

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

这是demo

【讨论】:

  • 非常感谢,这就是我要找的 :)
【解决方案2】:

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

exporting: {
    chartOptions: {
        ...
    }
}

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

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

【讨论】:

  • 感谢您的支持:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多