[英]Can you remove specific grid lines and point labels using highcharts without css?
[英]highcharts js how to add grid lines without labels
有没有一种方法可以在highcharts js图表中添加网格线,但是在现有线之间没有标签?
我已经有了值1、2、3等的网格线,我想在0.5、1.5、2.5等中添加线,但是轴上没有标签。
我还需要计算时间间隔(步骤之间的中间点,每次可能不同)。
您可以启用次要刻度线,并将其设置minorTickInterval
0.5。
API参考:
http://api.highcharts.com/highcharts/yAxis.minorTickInterval
检查yAxis.plotLines以添加其他网格线
小提琴演示
Highcharts.chart('container', { xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], }, yAxis: { tickPositions: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], //fix labels in yAxis plotLines: [{ color: '#ccc', width: 1, value: 0.5 //position where line needed }, { color: '#ccc', width: 1, value: 1.5 }, { color: '#ccc', width: 1, value: 2.5 }] }, series: [{ data: [1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10] }] });
<script src="https://code.highcharts.com/highcharts.js"></script> <div id="container" style="height: 400px"></div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.