如何在 Highcharts 中制作虚线条形图边框

Dav*_*lin 1 highcharts

我有一个带有两个数据属性的堆积条形图。我想让第二个条形看起来变灰并带有虚线边框。我试过 "dashStyle: 'longdash' 但这和我试过的其他任何东西都不起作用。

这是我要的外观: 在此处输入图片说明

Paw*_*Fus 5

通常它不受支持,但简单的 hack 可以启用它:http : //jsfiddle.net/ztRF5/132/(注意:需要来自 github 的最新版本)。

// mapping between SVG attributes and the corresponding options
Highcharts.seriesTypes.bar.prototype.pointAttrToOptions.dashstyle = 'dashStyle';

var chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container',
        type: 'bar'
    },
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },
    plotOptions: {
        bar: {
            stacking: 'percent'   
        }
    },
    series: [{
        data: [29.9],
        borderColor: 'black',
        borderWidth: 2,
        dashStyle: 'dash'
    }, {
        data: [13] 
    }]
});
Run Code Online (Sandbox Code Playgroud)