1
votes

http://jsfiddle.net/ramon_ackermann/PhjX7/2/

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

    chart: {
        type:'column'
    },
    xAxis: {
        min:0,
        max:0,
        categories: ["test"]
    },
    series: [{
        "name": "ABELO",
        "data": [
            0.73
        ]
    },{
        "name": "UAAU",
        "data": [
            0.77
        ]
    },{
        "name": "ANCB",
        "data": [
            1.72
        ]
    },
             {
        "name": "avg",
        "type": "line",
        "color": "#ff0000",
        "data": [
            {
                "x": -0.5,
                "y": 1.5
            },{
                "y": 1.5,
                "dataLabels": {
                    "enabled": true,
                    "align": "right",
                    "verticalAlign": "bottom",
                    "formatter": function(){
                        return 'avg:  ' + this.y;
                    },
                    "style": {
                        "fontWeight": "normal"
                    },
                    "x": 0.5
                }
            }
        ]
    }
]

});

});

Before updgrading to Highcharts 3, the code above would work properly, drawing the line from left to right, but since I'm trying to upgrade to v3, I can't get the line to draw all the way to the right.

I devised the above solution from my previous question / answers (highcharts line not fully plotted)

The above sample is a simplified version of what I need, unfortunately plotLines is not a solution for me.

2

2 Answers

0
votes

Simple solution is to extend another point onto your avg line:

...,{"x": 1.5, "y": 1.5}]

Why is a plotLine not appropriate?