我使用高圖創建了蜘蛛網圖,但是我在頂部和底部標籤中獲得重疊標籤。我嘗試包裝它們,並試圖錯開標籤,但我無法阻止它們重疊。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