我需要使用Highcharts(v3.0.1)的圖例標題,但是邊框不會渲染到標題的長度。這是一個錯誤嗎?我不能使用width
,因爲我使用的是layout: horizontal
。Highcharts傳說標題邊框不是全寬
添加多於1個系列時沒有問題,但如果您只有1個,則圖例佈局(視覺上)中會出現錯誤。
例子:http://jsfiddle.net/3cSVr/1/
$(function() {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'line',
},
plotOptions: {},
title: {
text: 'Monthly Average Temperature',
x: -20 //center
},
subtitle: {
text: 'Source: WorldClimate.com',
x: -20
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
yAxis: {
title: {
text: 'Temperature (°C)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +': '+ this.y +'°C';
}
},
legend: {
title: {
text: 'WorldClimate.com',
style: {
fontWeight: 'bold'
}
},
borderWidth: 2
},
series: [{
name: 'Tokyo',
data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
}
//Add more series;
]
});
});
});
感謝您的幫助。
謝謝塞巴斯蒂安,我會跟着這個修復的發佈。 – user2272228