chrisb89123456789

Random dashStyles in line chart?

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: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Random dashStyles in line chart?

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 Team Lead
chrisb89123456789

Re: Random dashStyles in line chart?

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: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Random dashStyles in line chart?

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 Team Lead

Return to “Highcharts Usage”