chart.js - Two Y-axis not aligning correctly
问题描述
I added two Y-axes into the chart, but for some reason they don't align correctly. The labels to the left are aligned slightly higher than the ones on the right.
What could be the issue here? I've tried messing around with some options etc, but no luck so far.
Any help is appreciated, thank you.
解决方案
Assuming your chart is of type
'horizontalBar'
, you could define the second y-axis as follows:
{
type: 'category',
position: 'right', // depends on your choice
offset: true,
gridLines: {
display: false
}
}
推荐阅读
- javascript - TagSuggest 验证 jquery
- regex - 替换文本值在 Apache-NiFi 中无法按预期工作
- javascript - 在 HTML 中将数据从一页发送到另一页
- c# - 解码 xml 时出错。"&" 无效标记。等待 ”;”
- java - 执行插入时获取 SQL 语法异常
- shell - 将书签文件夹名称转换为 Firefox 书签 JSON 导出中的标签
- oracle - 换行未通过 SSIS 上的 Attunity 驱动程序传输到 Oracle
- android - 为什么我不能为 LiveData 赋值?
- php - 如何在 Laravel 中将 JWT 令牌发送到 jQuery
- python - 如何合并两行并将所选列的值划分为新列