HighCarts Pie在饼图标签

时间:2018-04-27 09:10:58

标签: highcharts

如果在Highcharts.series.data数组中包含非偶数元素列表,则HighCarts Pie不显示1个值标签。

data: [
  ["1", 14.2],
  ["2", 14.2],
  ["3", 14.2],
  ["4", 14.2],
  ["5", 14.2],
  ["6", 14.2],
  ["7", 14.2]
]

data: [
  ["1", 14.2],
  ["2", 14.2],
  ["3", 14.2],
  ["4", 14.2],
  ["5", 14.2]
]

enter image description here

例如http://jsfiddle.net/370e7w6h/1/

我的配置错误,也许有人知道吗?

1 个答案:

答案 0 :(得分:1)

在plotOptions中,将大小从109%更改为100%。

 plotOptions: {
      pie: {
        dataLabels: {
        allowOverlap:true,
          enabled: true,
          distance: -20,
          color: '#fff',
          style: {
            fontWeight: 'bold',
            fontSize: '16px',
            textOutline: 'none'
          }
        },
        borderWidth: '7px',
        borderColor: '#fff',
        size: '100%',
        startAngle: -90,
        endAngle: 360,
        center: ['50%', '50%']
      },

http://jsfiddle.net/370e7w6h/2/