我想顯示0到100%之間的數據。條形圖的寬度爲160px,我希望看到沒有任何標題/傳說的酒吧。 我得到範圍在0和x之間的數據(例如從0到700),並且可以更改最大值。高級欄縮放
當最大值小於160時,條顯示正確。但是,如果最大值超過160個字符,則會錯誤地縮放當前欄值。
理想的結果
http://jsfiddle.net/dvasuta/H6SJE/2/
我有什麼現在 http://jsfiddle.net/dvasuta/sXAeh/2/
$(function() {
$('#container').highcharts({
credits: {
enabled: false,
},
chart: {
renderTo: 'container',
type: 'bar',
marginBottom: 1,
marginTop: 1,
marginLeft: 1,
marginRight: 1,
borderRadius: 0,
borderWidth: 1,
borderColor: '#c5c6c7',
backgroundColor: 0,
height: 22,
width:160
},
title: {
text: null
},
xAxis: {
tickWidth: 0,
lineWidth: 0,
gridLineWidth: 0,
categories: 0,
labels: {
enabled: false
}
},
yAxis: {
tickWidth: 0,
lineWidth: 0,
gridLineWidth: 0,
min: 0,
max: 2500,
title: {
text: null
},
labels: {
enabled: false
}
},
tooltip: {
enabled: false,
formatter: function() {
return '';
}
},
legend: {
enabled: false
},
plotOptions: {
bar: {
dataLabels: {
enabled: true,
formatter: function() {
return '';
},
y: 0,
x: 0,
color: '#ff0',
style: {
fontSize: '18px',
fontFamily: 'bold Helvetica,Arial,sans-serif'
}
}
},
series: {
allowPointSelect: false,
enableMouseTracking: false,
groupPadding: 0,
pointPadding: 0,
borderWidth: 0,
borderRadius: 0
}
},
series: [{
shadow: true,
data: [2482],
color: {
linearGradient: [20, 20, 0, 20],
stops: [
[0, '#B6D22D'],
[1, '#5C9135']
]
}
}]
});
});
似乎在chart.width參數的問題。但我怎樣才能設置圖表寬度?
謝謝你的回答! – Castro 2013-03-30 11:55:10