Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HighCharts : Is it possible to customize the colors of individual series?

I am using HighCharts for a line graph report. In this specific report I have been asked to Customize the colours of each series. The series will always stay the same. So for example:

John series: Blue dashed line Mary series: Solid Red Line

Does anyone know how to accomplish this?

like image 941
Tjaart Avatar asked Apr 20 '11 08:04

Tjaart


People also ask

How do I change colors in Highcharts?

Add which colors you want to colors and then set colorByPoint to true . Reference: http://api.highcharts.com/highstock#colors. http://api.highcharts.com/highcharts#plotOptions.column.colorByPoint.

Is it possible to pass multiple series in a chart in Highcharts?

You can pass multiple series in array and the chart can be generated.

What is marker in Highcharts?

Options for the point markers of line-like series. Properties like fillColor , lineColor and lineWidth define the visual appearance of the markers. Other series types, like column series, don't have markers, but have visual options on the series level instead.


1 Answers

Options can be set separately for each series.

var chart = new Highcharts.Chart({     chart: {         renderTo: 'container'     },     xAxis: {         type: 'datetime'     },      series: [{         name: 'John',         color: '#0066FF',         dashStyle: 'ShortDash',         data: [             [Date.UTC(2010, 0, 1), 29.9],             [Date.UTC(2010, 2, 1), 71.5],             [Date.UTC(2010, 3, 1), 106.4]         ]     },{         name: 'Mary',         color: '#FF0000',         data: [             [Date.UTC(2010, 0, 1), 60.9],             [Date.UTC(2010, 1, 1), 40.5],             [Date.UTC(2010, 2, 1), 90.0],             [Date.UTC(2010, 3, 1), 80.4]         ]     }] }); 

JsFiddle Example

like image 82
Eric C Avatar answered Sep 20 '22 18:09

Eric C