我有一個包含兩組數據的高圖表。數據的y軸上的數字彼此遠離。我一會兒看到了一個解決方案,一邊尋找別的東西,一邊找不到它爲我的生活。所以在重複一個問題的風險中,我怎樣才能讓160紅色像黃圈一樣靠近在一起。 如何縮小HighCharts中y軸上的數字之間的間距
如果我拼出來,它看起來像這個1 6 0,我需要看起來像這160.有誰知道什麼值控制嗎?
按照要求,這裏是我的代碼:
$(function() {
$('container').highcharts({
chart: {
zoomType: 'xy',
width: 640
},
xAxis: [{
categories: ['2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015'],
crosshair: true,
gridLineWidth: 1,
labels: {
style: {
fontSize: '15px'
}
}
}],
yAxis: [{ // Primary yAxis
gridLineWidth: 2,
tickInterval: 20,
fontWidth: 100,
title: {
text: '',
}
}, { // Secondary yAxis
tickInterval: 20,
title: {
text: 'Total Retrun %',
style: {
color: "#000000",
fontSize: '20px'
}
},
labels: {
format: '{value}',
style: {
color: "#000000",
fontSize: '20px'
}
}
}, ],
legend: {
layout: 'horizontal',
align: 'center',
x: 0,
verticalAlign: 'top',
y: 0,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF',
itemStyle: {
font: '15pt Helvetica',
},
},
series: [{
name: 'AirTransport',
type: 'column',
yAxis: 1,
data: [22.5, -1.9, -32.6, 22.3, 33.4, -6.1, 19.2, 50.7, 28.1, -8.6],
tooltip: {
valueSuffix: ''
},
pointWidth: 35,
color: "#b3b3b3"
}, {
marker: {
fillColor: '#FFFFFF',
lineWidth: 1,
lineColor: null
},
name: 'S&P 500',
type: 'line',
yAxis: 1,
data: [15.8, 5.5, -37.0, 26.5, 25.0, 2.1, 16.0, 32.4, 23.7],
color: "#000000"
}]
});
});
看起來你的標籤樣式不使用默認值。我們需要看到你的代碼給你更多的幫助,但是嘗試改變字體大小/家庭等。 – wergeld
什麼字體/大小/樣式應用於y軸標籤?這看起來不像「標準」風格。 –