gpt4 book ai didi

javascript - 将多行 labelString 添加到 yAxes Chart.js

转载 作者:行者123 更新时间:2023-12-01 17:35:44 27 4
gpt4 key购买 nike

我没有在任何解决这个问题的网站上找到任何问题,也没有找到任何关于如何回答它的文档......

如何使使用最新版本的 Chart.js 库制作的图表中的 y 轴接受多行字符串作为其 labelString?我试过了

"Percent of users <br> that can come today"


"Percent of users \n that can come today" 


"Percent of users &#13; that can come today".

这是我的代码,如有必要,我可以添加更多代码:
            yAxes: [{
ticks: {
beginAtZero: true,
max: 100,
stepSize: 25,
},
scaleLabel: {
display: true,
fontSize: 14,
labelString: "Percent of users \n that can come today",
}
}]

最佳答案

在图表的一侧创建一个单独的网格是可行的。

关于javascript - 将多行 labelString 添加到 yAxes Chart.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45377728/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com