249
Views
3
Comments
Solved
How to make a specific series in a chart have a dashed line?
Question

Hello, 


I have a line chart that is plotting a DataPointList with 3 DataSeriesName's, and right now the chart plots each series as a solid line (as this is the default). The series' are named "apple", "banana", and "orange". I figured out how to make the linestyle for all of them a dashed line, but how do I just do it for one of them (lets say the "orange" series)? I've tried looking at highcharts API but can't figure it out. 


Thanks!

2025-05-15 01-57-31
Grace Tamayo
Solution

James Carson wrote:

Hello, 


I have a line chart that is plotting a DataPointList with 3 DataSeriesName's, and right now the chart plots each series as a solid line (as this is the default). The series' are named "apple", "banana", and "orange". I figured out how to make the linestyle for all of them a dashed line, but how do I just do it for one of them (lets say the "orange" series)? I've tried looking at highcharts API but can't figure it out. 


Thanks!


Hi James,


You may use this and set style of dash per DataSeriesName if you were using the Charts\LineChart. 


Here's the result of the screenshot above.


You can find here the other possible values of dash as well. 

 https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/ 

And here, you can find the dashstyle from HighCharts API.

https://api.highcharts.com/highcharts/series.line.dashStyle

UserImage.jpg
sowndarya B

Hi Grace ,

I need to design my gridlines as  dotted. kindly help me if any solution for the same.

Regards,

Sowndarya

UserImage.jpg
James Carson

Thanks!!!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.