作者:r_elease靜 | 来源:互联网 | 2023-02-02 12:05
我已从高级图表下载饼图下载,但我有一些问题,我想删除饼图中列出的文字,任何人都可以帮助我,让我知道这是怎么回事
var colors = Highcharts.getOptions().colors,
categories = ['MSIE', 'Firefox', 'Chrome', 'Safari', 'Opera'],
data = [{
//y: 56.33,
color: colors[0],
drilldown: {
name: 'MSIE versions',
categories: ['General Public (Local)'],
data: [],
color: colors[0]
}
}, {
//y: 10.38,
color: colors[1],
drilldown: {
name: 'Firefox versions',
categories: ['Foreign (Ind. & Inst.)'],
data: [],
color: colors[1]
}
}, {
//y: 24.03,
color: colors[2],
drilldown: {
name: 'Chrome versions',
categories: ['Institutional'],
data: [],
color: colors[2]
}
}, {
//y: 4.77,
color: colors[3],
drilldown: {
name: 'Safari versions',
categories: ['Directors / Spouses'],
data: [],
color: colors[3]
}
}, {
// y: 0.2,
color: colors[5],
drilldown: {
name: 'Proprietary or Undetectable',
categories: [],
data: [],
color: colors[5]
}
}],
browserData = [],
versiOnsData= [],
i,
j,
dataLen = data.length,
drillDataLen,
brightness;
// Build the data arrays
for (i = 0; i 5 ? this.point.name : null;
},
color: '#ffffff',
distance: -30
}
}, {
name: 'Versions',
data: versionsData,
size: '90%',
innerSize: '40%',
dataLabels: {
formatter: function () {
// display only if larger than 1
return this.y > 1 ? '' + this.point.name + ': ' +
this.y + '%' : null;
}
},
id: 'versions'
}],
responsive: {
rules: [{
condition: {
maxWidth: 250
},
chartOptions: {
series: [{
id: 'versions',
dataLabels: {
enabled: false
}
}]
}
}]
}
});
我无法弄清楚如何删除在轮廓区域中显示的文本,文本在图表区域可见,任何人都可以帮助我
1> ali..:
您已在plotOptions下放置了dataLabels属性,但它应位于pie对象下.你的代码
plotOptions: {
pie: {
shadow: false,
center: ['50%', '50%']
},
dataLabels: {
enabled: false
}
}
将dataLabels放在plotOptions的下面,示例代码如下:
plotOptions: {
pie: {
shadow: false,
center: ['50%', '50%']
dataLabels: {
enabled: false
}
}
}
jsFiddle链接供参考.