chrisb89123456789
Posts: 28
Joined: Mon Jul 02, 2018 9:25 pm

Random dashStyles in line chart?

Tue Nov 27, 2018 9:07 am

Dear all,

is there an easy way to create line charts that can be printed in black and white (with different dash styles)?

Of course, I can specify an array of dash styles and assign them randomly. However, since highcharts is also assigns colors randomly I was just wondering whether there is an easier way to do this...

Thanks
Chris

rafalS
Posts: 664
Joined: Thu Jun 14, 2018 11:40 am

Re: Random dashStyles in line chart?

Tue Nov 27, 2018 12:51 pm

Hi, Chris!

Could you explain more precisely what do you want to achieve? Saying "printed" you mean exporting to e. g PDF? You want white series as e. g dots and black series as dash?

Best regards!
Rafal Sebestjanski,
Highcharts Developer

chrisb89123456789
Posts: 28
Joined: Mon Jul 02, 2018 9:25 pm

Re: Random dashStyles in line chart?

Wed Nov 28, 2018 12:41 pm

I would like to export the chart as PDF which I can then print on a BW printer.
Hence, each series should have black or gray as line color, but get dash-styles assigned randomly.
Was just wondering, whether there is a standard method to do this (instead of creating an array with different dash styles and randomly select a dash style)

rafalS
Posts: 664
Joined: Thu Jun 14, 2018 11:40 am

Re: Random dashStyles in line chart?

Wed Nov 28, 2018 5:13 pm

Well, Highcharts does not provide any built-in features or properties like this but, as you say, it can be easily automated using an array of dash styles.

In docs, I have found only this demo, but dash styles here are set rigidly: https://api.highcharts.com/highcharts/p ... .dashStyle

Also, I have found a similar topic with a nice plugin if you'd like to adapt a column chart to BW printing: viewtopic.php?t=21890

I'll be here if you have any additional questions.
Rafal Sebestjanski,
Highcharts Developer

Return to “Highcharts Usage”