如何禁用没有数据的HichCharts中出现的圆圈?

问题描述 投票:0回答:1

此示例https://jsfiddle.net/keagnm8y/是没有数据的饼图,图表显示一个圆圈。我如何不在图表上显示此周期?

谢谢!

// Build the chart
Highcharts.chart('container', {
    chart: {
        plotBackgroundColor: null,
        plotBorderWidth: null,
        plotShadow: false,
        type: 'pie'
    },
    title: {
        text: 'Browser market shares in January, 2018'
    },
    tooltip: {
        pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
    },
    plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
                enabled: false
            },
            showInLegend: true
        }
    },
    series: [{
        name: 'Brands',
        colorByPoint: true,
        data: []
    }]
});
highcharts geometry no-data
1个回答
0
投票

您可以将饼图的borderWidth设置为0。

    plotOptions: {
        pie: {
            borderWidth: 0
        }
    }

// Build the chart
Highcharts.chart('container', {
  chart: {
    plotBackgroundColor: null,
    plotBorderWidth: null,
    plotShadow: false,
    type: 'pie'
  },
  plotOptions: {
    pie: {
      borderWidth: 0
    }
  },
  series: [{
    data: []
  }]
});
<script src="https://code.highcharts.com/highcharts.js"></script>


<div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
© www.soinside.com 2019 - 2024. All rights reserved.