首页 > 解决方案 > 为 3d 条形图添加边框颜色和宽度

问题描述

我想更改 3d bar highchart 的边框颜色和宽度...

我尝试了什么:

// Set up the chart
var chart = new Highcharts.Chart({
    chart: {

        renderTo: 'container',
        type: 'column',
        options3d: {
            enabled: true,
            alpha: 15,
            beta: 15,
            depth: 50,
            viewDistance: 25
        }
    },
    yAxis:{
    gridLineWidth:0,
    visible:false,
    },
    xAxis: {
    gridLineWidth:0,
    categories:['Jan','feb']
    },
    title: {
        text: 'Chart rotation demo'
    },
    subtitle: {
        text: 'Test options by dragging the sliders below'
    },
    plotOptions: {
        column: {
            depth: 25,
          color:'blue,
        },
        series: {

     showInLegend: false,
            dataLabels: {
                enabled: true,
                align: 'center',
                color: 'black',
                x: 0,
                y:2

            },
            pointPadding: 0.2,
            groupPadding: 0
        }
    },
    series: [{
        data: [0, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
    }]
});

获取输出: 输出屏幕的链接

我想为条形和边框获得不同的颜色.....

我也试过:

列{边框宽度:3,边框颜色:'红色'}

提前致谢!!!

标签: javascripthtmlangularhighcharts

解决方案


用途edgeColoredgeWidth性能:

    series: [{
        edgeColor: 'red',
        edgeWidth: 5,
        ...
    }]

现场演示: https ://jsfiddle.net/BlackLabel/yx9n43os/

API参考:

https://api.highcharts.com/highcharts/series.column.edgeColor

https://api.highcharts.com/highcharts/series.column.edgeWidth


推荐阅读