简体   繁体   English

高图表无法隐藏饼图数据标签

[英]High Charts Can't hide Pie Chart data labels

I am working on an application using AngularJS and I am using Highcharts to display a pie chart of some data. 我正在使用AngularJS开发应用程序,并且正在使用Highcharts显示一些数据的饼图。 The problem I am having is that the data labels for each pie slice are not hiding. 我遇到的问题是每个饼图的数据标签都没有隐藏。 I have tried the following after googling the topic but it doesn't work. 在搜索了该主题后,我尝试了以下操作,但是它不起作用。 Any suggestions. 有什么建议么。

$scope.chartConfig = {
        options: {
            chart: {
                type: 'pie'
            }
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: false
                }
            }
        },
        series: [{
            type: 'pie',
            name: 'All Tickets',
            data: [
                ['Scheduled', 5],
                ['Completed', 8]]
        }],
        title: {
            text: 'Ticket Information'
        }
    };

HTML File HTML文件

<div id="order-list-graph" class="pull-left">
  <highchart id="ticketHighChart" config="chartConfig" class="span10"></highchart>
</div>

I figured out what to do. 我知道该怎么办。 I needed to place the plotOptions object within the options object as such: 我需要将plotOptions对象放置在options对象中,如下所示:

options: {
  chart: {
    type: 'pie',
    animation: false
  },
  plotOptions: {
    pie: {
      allowPointSelect: true,
      cursor: 'pointer',
      dataLabels: {
        enabled: false
      }
    }
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM