数据标签在3D饼图中放错了位置

时间:2019-09-27 08:19:48

标签: angular highcharts

当数据labels.enabled设置为true时,数据标签显示不正确。我在angular 7应用程序中使用企业级图表,数据标签必须在图表内,因为该区域很小,因此不能将数据标签放在外面。

不确定是已知错误还是我缺少的东西。饼图在非3D模式下可以正常工作。

Highcharts.chart('container', {
  chart: {
    type: 'pie',
    options3d: {
      enabled: true,
      alpha: 45,
      beta: 0
    }
  },
  title: {
    text: 'Browser market shares at a specific website, 2014'
  },
  tooltip: {
    pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
  },
  plotOptions: {
    pie: {
      allowPointSelect: true,
      cursor: 'pointer',
      depth: 35,
      dataLabels: {
        enabled: true,
        format: '{point.name}',
        distance: -70
      }
    }
  },
  series: [{
    type: 'pie',
    name: 'Browser share',
    data: [
      ['Firefox', 20.0],
      ['IE', 10],
      {
        name: 'Chrome',
        y: 12.8,
        sliced: true,
        selected: true
      },
      ['Safari', 20],
      ['Opera', 10],
      ['Others', 10]
    ]
  }]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-3d.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>

<div id="container" style="height: 400px"></div>

0 个答案:

没有答案