删除带有高图的行

时间:2015-01-23 02:21:49

标签: javascript highcharts

如果我在Highcharts中使用散点图,有没有办法获得掉线?下拉线是从x轴回到点的线,如下所示:

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以使用组合列线图表执行此操作。

在此处查看此操作: http://jsfiddle.net/8qvy79gv/

$(function () {
$('#container').highcharts({
    title: {
        text: 'Combination chart'
    },
    xAxis: {
        categories: ['Apples', 'Oranges', 'Pears', 'Bananas', 'Plums']
    },
    labels: {
        items: [{
            html: 'Total fruit consumption',
            style: {
                left: '50px',
                top: '18px',
                color: (Highcharts.theme && Highcharts.theme.textColor) || 'black'
            }
        }]
    },
    series: [{
        type: 'column',
        name: 'Jane',
        pointWidth: 2,
        data: [3, 2.67, 3, 6.33, 3.33]
    }, {
        type: 'spline',
        name: 'Average',
        data: [3, 2.67, 3, 6.33, 3.33],
        marker: {
            lineWidth: 2,
            lineColor: Highcharts.getOptions().colors[3],
            fillColor: 'white'
        }
    }]
});

});