【发布时间】:2023-01-12 07:16:24
【问题描述】:
我在一个页面上有一堆图表,它们都是“折线”图表,它们都在 X 轴和 Y 轴上使用“线性”刻度。我很想摆脱不得不做的事情
const graph1 = new Chart(ctx1, {
type: 'line',
options: {
scales: {
x: {
type: 'linear',
},
y: {
type: 'linear',
},
},
},
});
而不是只是做:
const graph1 = new Chart(ctx1, {});
我尝试设置Chart.defaults.type 和Chart.defaults.scales.type 无济于事。
还有Chart.options.type。
【问题讨论】:
标签: chart.js