然后,在这里,我正在努力处理饼图的情节。
当我使用useHTML为true时,它完全按照我想要的方式呈现(也尊重itemWidth),但是当我点击图例时,它会停止尊重itemWidth并且项目重叠。 JSFiddle 代码:
$(function () {
$('#container').highcharts({
chart: {
renderTo: 'container',
height: 660,
width: 400,
},
title: {
text: 'Example',
},
plotOptions: {
pie: {
center: [200, 50],
size: '150',
innerSize: '75%',
dataLabels: {
enabled: false,
},
showInLegend: true
}
},
legend: {
useHTML:true,
verticalAlign: 'top',
floating: true,
itemWidth: 180,
y: 200,
itemStyle: {
fontSize:'12px',
fontWeight: 'light',
width: 160
}
},
series: [{
type: 'pie',
data: [['Aaaaaaaaaaaaa aaaaaaaaaaaaa',0.0516218483578],['bbbbbbbbbbbbbb bbbbbbbbbbbbbbbb ',0.257286564668],['cccccccccccccccccc',1.12221284311],['dddddddd ddddddddd',1.1265250728],['rrrrrrr rrrrrrrrrrr',0.17346294958],['Aaaaaaaaaaaaa aaaaaaaaaaaaa ',1.20890386677],['ffffffff ',0.459460369787],['gfdgdfgdfg ',6.13592008543],['Aaaaaaaaaaaaa aaaaaaaaaaaaa ',0.395214054153],['Aaaaaaaaaaaaa aaaaaaaaaaaaa',0.366061664716],['dddddddddd',0.149098291043],['Aaaaaaaaaaaaa aaaaaaaaaaaaa',0.0957028394272],['tttttttttttt ',3.48603058953],['Aaaaaaaaaaaaa aaaaaaaaaaaaa',1.6316529146],['fdsfsdfsd .',1.34404210477],['Aaaaaaaaaaaaa aaaaaaaaaaaaa',0.350541259163],['Aaaaaaaaaaaaa aaaaaaaaaaaaas ',0.45563482302],['gdffdgdgg ',0.601007305701],['Aaaaaaaaaaaaa aaaaaaaaaaaaa',1.07655357912],['Aaaaaaaaaaaaa aaaaaaaaaaaaa ',0.145888955634],['Aaaaaaaaaaaaa aaaaaaaaaaaaa',13.0487584317],['dasdasfsafsaf',1.79394965159],['Vesdfsdrde ',3.41252042196],['Aaaaaaaaaaaaa aaaaaaaaaaaaa ',0.258638673662],],
}]
});
});
如果点击图例后如何保留格式?
答案 0 :(得分:0)
在最近的版本中似乎已经解决了这个问题。