0

在 Angular 4 项目中,我使用 angular2-highcharts 库来创建堆叠条形图。以下对象是我到目前为止的配置。

{
  title: { text: '' },
  xAxis: {
    categories: [''],
    crosshair: true,
    visible: false
  },
  yAxis: {
    min: 0,
    max: 100,
    title: {
      text:  ''
    },
    labels: {
      enabled: true
    },
    visible: false
  },
  chart: {
    type: 'bar',
    backgroundColor: 'rgba(255, 255, 255, 0.1)'
  },
  legend: {
    enabled: false
  },
  plotOptions: {
    column: {
      pointPadding: 0,
      borderWidth: 0,
      stacking: 'normal',
      dataLabels: {
        enabled: true,
        formatter: function() {
          return this.point.y + '%';
        },
        inside: true
      },
      enableMouseTracking: false,
    },
    series: {
      stacking: 'normal',
      dataLabels: {
        enabled: true,
        formatter: function () {
          if (this.point.y) {
            return this.point.y + '%';
          }
          return '';
        },
        style: { fontSize: '10px' },
        padding: 10
      },
      borderWidth: 0
    }
  },
  series: [{
    name: 'Pending',
    data: ...,
    color: '#ff4233'
    }, {
    name: 'Executed',
    data: ...,
    color: '#34d788'
    }, {
    name: 'Cancelled',
    data: ...,
    color: '#8f8c87'
    }]
}

这会产生这个视觉结果->在此处输入图像描述

我需要将其转换为 ->在此处输入图像描述

正如您在所需结果中看到的那样,图表具有更高的高度,并且它的边缘也是圆形的。我不知道该怎么做。

4

1 回答 1

1

您是否尝试过使用圆角插件?有了它,您可以使用以下属性:

borderRadiusTopLeft, borderRadiusTopRight,borderRadiusBottomRightborderRadiusBottomLeft

插件参考:
https ://github.com/highcharts/rounded-corners

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

于 2017-07-26T14:54:35.057 回答