Chart.js StackedBar错误:this.labelsFilter不是函数

时间:2016-03-20 16:55:08

标签: jquery chart.js

我使用Chart.js版本1.0.2和Chart.StackedBar.js,我有这个错误:

chart.js:1995 Uncaught TypeError: this.labelsFilter is not a function(anonymous function) @ chart.js:1995
helpers.each @ chart.js:204
Chart.Scale.Chart.Element.extend.draw @ chart.js:1992
Chart.Type.extend.draw @ Chart.StackedBar.js:534
animationFrame @ chart.js:720

这是我的代码(使用KnockoutJS):

var dbData = {
labels: ko.utils.arrayMap(self.labelArrays(), function (data) { return data; }),
datasets: ko.utils.arrayMap(self.labelArrays(), function (
return {
label: label,
fillColor: '#fillColor',
strokeColor: "#strokeColor",
highlightFill: '#highlightFillColor',
highlightStroke: '#highlightStrokeColor',
data: self.getValueArraysByLabel(label)
}
})
};

var ctx = document.getElementById('chart1').getContext("2d");
window.Chart1 = new Chart(ctx).StackedBar(dbData, { responsive: true });

感谢您的帮助!

0 个答案:

没有答案