我正在尝试制作一个bar chart,它将在非0的基点上和基点下显示数据。
我尝试使用yAxes scales选项的最小和最大值,但它仅隐藏了'beginAtZero‘设置为false时超过设置的最小/最大值的条形图。
scales: {
yAxes: [{
ticks: {
min: 20,
scaleBeginAtZero: false,
beginAtZero: false
}
}],
}发布于 2019-08-20 15:46:13
通过使用以下命令,我能够显示所需的图表数据:
a. Chartjs多浮动条
示例:http://pravopys.net/chartjs/samples/charts/bar/vertical.html
GitHub:https://github.com/cprimera/Chart.MultiFloatingBar.js/blob/master/samples/multi-floating-bar.html
b. Chartjs注解插件(用于基点水平线)
const Chart = require("chart.js");
const Annotation = require("chartjs-plugin-annotation");
Chart.plugins.register(Annotation);
预览图片:final chart
https://stackoverflow.com/questions/57287924
复制相似问题