某些饼图中未显示的数据标签将处理Highchart [英] Data label not showing in some pie chart handles Highchart

查看:59
本文介绍了某些饼图中未显示的数据标签将处理Highchart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在highchart饼图中有一个奇怪的问题.

I am having a weird a problem in highchart piechart.

如果点数大于6,并且其中一个具有一个较小的1.2%的百分比,较小的点将不会显示数据标签.

If the number of points are more than 6 and if one of them having a less percentage of 1.2% the lesser point won't show data labels.

我不确定这是否是正确的情况.

I am not sure whether it is the exact scenario.

这是我的javascript文件

This is my javascript file

    Highcharts.chart('container', {
    chart: {
        type: 'pie'
    },
    series: [{
        name: 'Brands',
        data: [
        {name: "Nike", y: 91.6},
        {name: "Adidas", y: 2.2},
        {name: "Puma", y: 2.0},
        {name: "Skechers", y: 1.6},
        {name: "North face", y: 1.4},
        {name: "Asics", y: 1.2},
    ],
    }],
});

这是我的jsfiddle

有人可以帮我解决这个问题吗?

Can any one please help me to solve this?

推荐答案

通过设置 series.dataLabels.padding:0 ,您可以显示所有这样的标签:

By setting series.dataLabels.padding : 0 you can show all labels like that:

series: [{
  name: 'Brands',
  dataLabels: {
    padding: 0
  },
  data: [{
      name: "Nike",
      y: 91.6
    },
    {
      name: "Adidas",
      y: 0.2
    },
    {
      name: "Puma",
      y: 0.2
    },
    {
      name: "Skechers",
      y: 1.6
    },
    {
      name: "North face",
      y: 0.2
    },
    {
      name: "Asics",
      y: 0.2
    },
  ]
}]

小提琴

这篇关于某些饼图中未显示的数据标签将处理Highchart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆