Как изменить цвет графика серии Highcharts на черно-белый при загрузке его в виде изображения? - PullRequest
2 голосов
/ 07 апреля 2019
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.

Ответы [ 2 ]

0 голосов
/ 08 апреля 2019

Вы можете изменить цвета для экспорта с помощью свойства chartOptions:

exporting: {
    chartOptions: {
        ...
    }
}

Живая демоверсия: http://jsfiddle.net/BlackLabel/8typuasx/

Справочник по API: https://api.highcharts.com/highcharts/exporting.chartOptions

0 голосов
/ 08 апреля 2019

Используйте опцию экспорта, чтобы изменить цвета по умолчанию на черный:

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

Вот демо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...