我的yAxis部分看起来像这样:
yAxis: {
title: {
text: 'Height of tide<br>in feet.'
},
gridLineColor: '#197F07',
gridLineWidth: 0,
lineWidth:1,
plotLines: [{
color: '#FF0000',
width: 1,
value: 0
}]
},
我如何将y = <0的线的颜色更改为(红色)?
您可以使用negativeColor属性更改颜色。低于阈值的图形部分或点的颜色。默认阈值为0。
Highcharts.chart('container', { series: [{ data: [-6.4, -5.2, -3.0, 0.2, 2.3, 5.5, 8.4, 8.3, 5.1, 0.9, -1.1, -4.0], negativeColor: '#FF0000' }] });
<script src="https://code.highcharts.com/highcharts.js"></script> <div id="container" style="height: 400px"></div>
API参考:https://api.highcharts.com/highcharts/plotOptions.line.negativeColor