【发布时间】:2021-12-22 13:23:28
【问题描述】:
如图所示,点在到达底部或顶部边缘时被切成两半(在本例中数据为 1 或 5 时)。
我尝试了填充,添加了一些“假”数据来扩展 1 和 5 的限制,并使用刻度上的回调函数将其删除。没有一个按预期工作
这是我对这个图表的配置。
const config = {
type: 'line' as ChartType,
data: data,
options: {
pointStyle: 'circle',
//pointBackgroundColor: 'white',
scales: {
y: {
ticks: {
maxTicksLimit: 5,
stepSize: 1,
},
min: 1,
max: 5,
reverse: true,
},
},
},
};
但我需要最小值和最大值,因为我想要固定的 Y 轴值
任何线索如何解决这个问题?
【问题讨论】:
标签: javascript angular typescript configuration chart.js