我的Y轴数组:
["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24"]
图表不显示所有数字,仅显示1,3,5等。正在跳过2,4,6。如何强制Highcharts显示所有标签?
答案 0 :(得分:2)
答案 1 :(得分:0)
默认行为是如果它们彼此太靠近则删除刻度线。您可以使用tickPositioner
强制所有刻度,而不是指定categories
:
yAxis: {
title: null,
tickPositioner: function () {
return [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24];
}
},
请注意,引号已被删除,即返回的数组包含数字(而不是原始问题中的字符串文字)。不知道为什么它不能用于字符串文字。