我尝试使用 EMI 计算器模块,但在属性“xAxes”上遇到错误,该错误在类型“_DeepPartialObject<{ [key: string]: ScaleOptionsByType; }>' 。
我无法联系 github 中的开发人员。我可以在这个小组寻求建议吗?
https://github.com/eskutti/EMI-Calculator/issues/1
this.barChart = new Chart(this.barCanvas.nativeElement, {
type: 'bar',
data: {
labels: labels,
datasets: [{
label: 'Perincipal',
backgroundColor: "rgba(0, 179, 0,0.5)",
data: principals
}, {
label: 'Interest',
backgroundColor: "rgba(255, 26, 26, 0.5)",
data: interests
}]
},
options: {
title: {
display: false,
},
tooltips: {
mode: 'index',
intersect: false
},
responsive: true,
scales: {
xAxes: [{
gridLines: {
display: false
},
stacked: true,
}],
yAxes: [{
gridLines: {
display: false
}, ticks: {
// Include a dollar sign in the ticks
callback: function (value, index, values) {
let n = value;
let d = 2;
let x = ('' + n).length;
let p = Math.pow;
d = p(10, d)
x -= x % 3
return Math.round(n * d / p(10, x)) / d + " kMGTPE"[x / 3]
//return this.abbrNum(value, 2);
}
},
stacked: true,
}]
}
}
});