某些饼图中未显示的数据标签处理 Highchart
Data label not showing in some pie chart handles Highchart
我在 highchart 饼图中遇到了一个奇怪的问题。
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.
我不确定这是否是确切的场景。
这是我的 javascript 文件
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},
],
}],
});
谁能帮我解决这个问题?
通过设置 series.dataLabels.padding : 0
您可以显示所有标签:
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 饼图中遇到了一个奇怪的问题。
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.
我不确定这是否是确切的场景。
这是我的 javascript 文件
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},
],
}],
});
谁能帮我解决这个问题?
通过设置 series.dataLabels.padding : 0
您可以显示所有标签:
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
},
]
}]