在highcharts中,默认情况下x轴上有刻度线,就像在x轴上一样(下面的代码片段),但我找不到任何方法在y轴上创建刻度线。这是可能的吗?
$(function () {
$('#container').highcharts({
title:{
text:''
},
xAxis: {
gridLineColor: 'transparent',
title: {
text: "x"
},
gridLineWidth: 1,
min: -5,
max: 5,
tickInterval: 1,
},
yAxis: {
gridLineColor: 'transparent',
title: {
text: "y"
},
min: -5,
max: 5,
tickInterval: 1,
lineWidth: 1,
title: {
text: null
}
},
legend: {
enabled: false
},
series: [{
type: "line",
marker: {
enabled: false
},
data: [
[-3, 3],
[-2, 2],
[-1, 1],
[0, 0],
[1, 1],
[2, 2],
[3, 3]
]
}]
});
});
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="width: 400px; height: 400px"></div>
答案 0 :(得分:4)