我使用高图创建了蜘蛛网图,但是我在顶部和底部标签中获得重叠标签。我尝试包装它们,并试图错开标签,但我无法阻止它们重叠。Highcharts蜘蛛网标签重叠(顶部和底部)
$(function() {
$('#spiderchartFull').highcharts({
chart: {
polar: true,
type: 'line',
marginLeft: 120,
marginRight: 120
},
title: {
text: 'Liste des interdépendances a la biodiversité et aux services écologiques'
},
subtitle: {
text: 'Détaillé'
},
xAxis: {
categories: [
'Production végétale',
'Production animale',
'Produits biotiques marins',
'Produits biotiques d\'eau douce',
'Aquaculture',
'Eau potable',
'Matières minérales',
'Energie renouvelable issue du vivant',
'Energie non renouvelable issue du vivant',
'Energie renouvelable abiotique',
'Dépollution',
'Assimilation des déchets',
'Régulation des flux gazeux',
'Régulation des flux hydriques',
'Régulation des phénomènes érosifs',
'Régulation de la qualité de l\'air',
'Régulation de la qualité de l\'eau',
'Régulation de la qualité des sols',
'Régulation du climat global',
'Régulation du climat local',
'Maintenance du cycle de vie et protection des habitats',
'Régulation des pathogènes et parasites',
'Conservation des stocks génétiques',
'Recherche scientifique',
'Education',
'Esthétiques et culturels',
'Religieux',
'Récréation',
'Volontariat'],
labels: {
style: {
fontSize: '13px',
fontFamily: 'Verdana, sans-serif',
width: 150,
}
},
tickmarkPlacement: 'on',
lineWidth: 0,
},
yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0,
max: 5,
title: {
text: 'Rainfall (mm)'
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [{
name: 'Dépendances aux SE',
data: [1.0, 2.0, 3.6, 4.7, 5.0, 1.1, 2.75, 4.33, 4.43, 3.52, 1.0, 2.0, 3.6, 4.7, 5.0, 1.1, 2.75, 4.33, 4.43, 3.52, 1.0, 2.0, 3.6, 4.7, 5.0, 1.1, 2.75, 4.33, 4.43],
pointPlacement: 'on'
}, {
name: 'Transactions monétaires associées',
data: [2.0, 3.0, 2.6, 1.7, 1.0, 1.3, 2.235, 4.323, 4.43, 4.52, 2.0, 1.0, 3.6, 3.7, 5.0, 1.1, 2.75, 4.33, 4.43, 3.52, 1.0, 2.0, 3.6, 4.7, 5.0, 1.1, 2.75, 4.33, 4.43],
pointPlacement: 'on'
}],
legend: {
itemStyle: {
width: 100
},
}
});
});
在这里你可以看到我创建的highchart:http://jsfiddle.net/Rfaav/4/
我建议更改图表的大小,因为你有太多的datalabels和身体是不可能将其定位为小格。 – 2013-05-07 12:27:20
DIV的大小不是问题(改变它会导致同样的问题)。问题是标签和图形之间的间距。如果有一种方法可以添加边距或填充以使标签距离比标签更远以解决重叠问题。 – Androidus 2013-05-07 20:06:18
嘿,我面临同样的问题。 – Neelam 2013-05-26 15:16:17