简体   繁体   中英

How to display grid line on top of highchart

How to display the grid line on top of chart,

I'm having red color grid line in my chart, how to display the grid line on top of chart

I'm trying by setting index in css

code:

$(function () {
    $('#container').highcharts({

        credits: {
            enabled: false
        },

        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },

                yAxis: {
            gridLineColor: 'red'
        },

        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]
        }]
    });
});

Fiddle link: http://jsfiddle.net/pewx4esm/1/

Helps much appreciated

Try this:

$(function () {
$('#container').highcharts({
    credits: {
        enabled: false
    },

    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

            yAxis: {
        gridLineColor: 'red',
                gridZIndex:90
    },

    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]
    }]
});

浏览http://www.highcharts.com/docs/chart-and-series-types/chart-types以获取有关highcharts的任何属性的帮助

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM