[英]How to show tick marks and labels with grid line for the specific one on the X axis with Chart.js?
use this for your labels array:将此用于您的标签数组:
labels: [["jan", 20], "", "", "", "", "", ["jul", 20], "", "", "", "", "", ["jan", 21]],
and this to your options object:这是您的选项 object:
options: {
scales: {
xAxes: [{
ticks: {
callback: (label) => (label === "" ? null : label)
}
}]
}
}
will get the following result:将得到以下结果:
Since the tick marks are getting generated from the grid lines they dissapear too, dont know how you can fix that由于刻度线是从网格线生成的,它们也消失了,不知道如何解决这个问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.