admin管理员组文章数量:1429039
Using the Chart.bundle.js script (documentation here), I've created a Line Chart within a object in javascript. Furthermore, my x-axis is numerical, ranging from -100 to 100. It is very important to me that there be a clear distinction between negative and positive numbers, and so I am trying to show a clear, bold x-axis on my Chart object; however, it doesn't seem like Chart.js provides this feature-or perhaps I just cannot find it. Is there any way of making a thicker x-axis? I am open to both conventional solutions as well as hacky ones, if necessary.
Using the Chart.bundle.js script (documentation here), I've created a Line Chart within a object in javascript. Furthermore, my x-axis is numerical, ranging from -100 to 100. It is very important to me that there be a clear distinction between negative and positive numbers, and so I am trying to show a clear, bold x-axis on my Chart object; however, it doesn't seem like Chart.js provides this feature-or perhaps I just cannot find it. Is there any way of making a thicker x-axis? I am open to both conventional solutions as well as hacky ones, if necessary.
Share Improve this question asked Aug 31, 2017 at 22:14 David CDavid C 2133 silver badges8 bronze badges2 Answers
Reset to default 2In your options, you can set the lineWidth
option:
options: {
scales: {
xAxes: [{
gridLines: { lineWidth: 50 },
}]
}
}
And the corresponding docs
for x-axis to be more thicker we set in yAxes gridLines this line
zeroLineWidth:2
for y-axis to be more thicker we set in xAxes gridlines this line
zeroLineWidth:2
documentation:
enter link description here
yAxes: [{
gridLines: {
zeroLineWidth:2
}
}],
xAxes: [{
gridLines: {
zeroLineWidth:2
}
}]
本文标签: javascriptThicker XAxis with ChartsjsStack Overflow
版权声明:本文标题:javascript - Thicker X-Axis with Charts.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745414053a2657599.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论