我已经写了很多这些图表并且从未遇到过这个问题。我的y轴标签未显示在此特定图表中:
$(function () {
$('#container').highcharts({
chart: {
alignTicks: false,
animation: {
animation: false
},
height: 180,
reflow: true,
width: 425,
zoomType: 'x'
},
credits: {
enabled: false
},
legend: {
enabled: false,
layout: 'horizontal'
},
plotOptions: {
line: {
animation: false,
marker: {
radius: 0
},
stickyTracking: false,
turboThreshold: 5000000,
zIndex: 1
},
spline: {
animation: false,
marker: {
radius: 0
},
turboThreshold: 5000
}
},
title: {
text: ''
},
tooltip: {
backgroundColor: '#303030',
borderColor: 'white',
borderRadius: 0,
borderWidth: 1,
style: {
font: '20pt [FontFamily: Name=Microsoft Sans Serif]',
padding: '10px',
color: 'white'
},
valueDecimals: 0,
valueSuffix: 'F'
},
xAxis: {
categories: ['Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Mon', 'Tue'],
lineColor: 'black',
lineWidth: 2
},
yAxis: {
endOnTick: false,
gridLineWidth: 0,
lineWidth: 2,
maxPadding: 0,
minPadding: 0,
startOnTick: false,
id: 'ForecastData',
lineColor: 'black',
linkedTo: 0,
offset: 0,
title: {
text: ''
},
type: "linear"
},
exporting: {
buttons: {
exportButton: {
enabled: false
},
printButton: {
enabled: false
}
},
enabled: false
},
series: [{
data: [33, 31, 35, 33, 36, 37, 36],
labelText: 'Daily Min Temperature',
name: 'Daily Min Temperature',
type: 'spline',
color: '#2177E0'
}]
});
});
我似乎无法弄清楚我错过了什么。有什么想法吗?
谢谢!
答案 0 :(得分:1)
尝试用此
替换x和y轴xAxis: {
categories: ['Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Mon', 'Tue'],
lineColor: 'black',
lineWidth: 2
},
yAxis: {
title: {
text: 'DATA'
},
lineColor: 'black',
lineWidth: 2
categories: ['1', '2', '3', '4', '5', '6', '7'],
},
或者从代码中删除linkedTo。