Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts: Style Zero Y value

Tags:

highcharts

I have a line graph where Y values are -10 to +60. I would like to style the y=0 line to stand out from other grid lines. Is this possible? Thanks.

like image 643
user2182620 Avatar asked Mar 20 '13 16:03

user2182620


1 Answers

Take a look at the plotLines API in the yAxis...

http://api.highcharts.com/highcharts#yAxis.plotLines

Example... http://jsfiddle.net/48dUL/

$(function () {
var chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container'
    },
    xAxis: { 
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
    },
            yAxis: { 
        plotLines: [{
            color: '#C0C0C0',
            width: 5,
            value: 0
        }]
    },

    series: [{
        data: [-29.9, -71.5, -106.4, -129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]
});

});

like image 138
Frank Reno Avatar answered Nov 03 '22 15:11

Frank Reno