HighCharts:添加虚线

时间:2015-03-10 08:49:10

标签: highcharts

我有这个HighCharts:

$('#container').highcharts({
    chart: {
        type: 'scatter'
    },
    title: {
        text: 'Title'
    },
    plotOptions: {
        scatter: {
            dataLabels: {
                enabled: true,
                formatter: function() {
                    return this.point.value;
                }
            }
        }
    },
    series: [
            {
                name: 'Points',
                data: [
                    { x: 10, y: 25, value: 96.1 },
                    { x: 50, y: 25, value: 96.3 },
                    { x: 10, y: 50, value: 96.0 },
                    { x: 50, y: 50, value: 96.3 },
                    { x: 90, y: 50, value: 96.4 },
                    { x: 100, y: 50, value: 96.5 },
                    { x: 10, y: 100, value: 96.1 },
                    { x: 50, y: 100, value: 96.3 },
                    { x: 100, y: 100, value: 96.6 }
                ]
            }
        ]
});

我想用虚线标记90/100点。我怎么能这样做?

enter image description here

请参阅my JSFiddle

1 个答案:

答案 0 :(得分:2)

我会将scatter系列用于启用行:http://jsfiddle.net/6x6s09d8/4/

{
    data: [
        [90, 20],
        [90, 100],
        [10, 100]
    ],            
    lineWidth: 2,
    dashStyle: 'Dash',
    lineColor: 'black',
    type: 'scatter',
    marker: {
        enabled: false  
    },
    showInLegend: false,
    enableMouseTracking: false
}

现在唯一的限制是为两个轴设置minPadding: 0