Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highchart yAxis plotLines label position

Tags:

I am having an issue of relocate yAxis.plotLines.label position. enter image description here

I want to move label from original position to under the plotLine. Please check this link

Highcharts.chart('container', {
    xAxis: {
        tickInterval: 24 * 3600 * 1000, // one day
        type: 'datetime'
    },

    yAxis: {
        plotLines: [{
            color: 'red',
            width: 2,
            value: 100,
            label: {
                text: 'Plot line',
                align: 'right'
            }
        }]
    },

    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4],
        pointStart: Date.UTC(2010, 0, 1),
        pointInterval: 24 * 3600 * 1000
    }]
});
like image 761
Qing Xu Avatar asked Sep 26 '17 04:09

Qing Xu


1 Answers

check xAxis.plotLines.label.y to adjust the label positin

Fiddle demo

 yAxis: {
    plotLines: [{
        color: 'red',
        width: 2,
        value: 100,
        label: {
            text: 'Plot line',
            align: 'right',
            y: 20, /*moves label down*/
        }
    }]
},
like image 197
Deep 3015 Avatar answered Oct 11 '22 14:10

Deep 3015