如何获取仅针对起点和终点绘制的高亮图

时间:2015-08-21 05:49:29

标签: javascript highcharts

http://jsfiddle.net/cpcrxnbn/

在此高清图中,所有可用点都有填充白色的绘图标记。但是,如何获得仅用于开始和结束位置的情节?

$(function(){
    $('#container').highcharts({
        xAxis: {
            categories: ['Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },

        plotOptions: {
            series: {
                marker: {
                    fillColor: '#FFFFFF',
                    lineWidth: 2,
                    lineColor: null // inherit from series
                }
            }
        },

        series: [{
            data: [176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
        }]
    });
});

1 个答案:

答案 0 :(得分:1)

您可以禁用整个系列的标记并启用每个特定点。

series: [{
        marker: {
            enabled: false
        },
        data: [{
            y: 176.0,
            marker: {
                enabled: true,
                fillColor: '#ffffff',
                lineWidth: 2,
                lineColor: colors[0] // inherit from series
            }
        },
        135.6, 148.5, 216.4, 194.1, 95.6, {
            y: 54.4,
            marker: {
                enabled: true,
                fillColor: '#ffffff',
                lineWidth: 2,
                lineColor: colors[0] // inherit from series
            }
        }]
    }]

示例:http://jsfiddle.net/cpcrxnbn/3/