Extjs4 为什么';y属性的意外值;使用ExtJS绘制饼图时显示警告?

Extjs4 为什么';y属性的意外值;使用ExtJS绘制饼图时显示警告?,extjs4,pie-chart,Extjs4,Pie Chart,我试图用ExtJS绘制一个饼图,但出现了一些问题。我可以在firebug窗口中看到以下警告: Unexpected value NaN parsing y attribute. Unexpected value NaN parsing height attribute. 我的饼图代码如下所示: xtype: 'chart', title: 'Location wise candidate distribution', itemId: 'CandidateDistributionChart',

我试图用ExtJS绘制一个饼图,但出现了一些问题。我可以在firebug窗口中看到以下警告:

Unexpected value NaN parsing y attribute.
Unexpected value NaN parsing height attribute.
我的饼图代码如下所示:

xtype: 'chart',
title: 'Location wise candidate distribution',
itemId: 'CandidateDistributionChart',
store: 'CandidateDistribution',
width: 250,
height: 260,
shadow: true,
animate: true,
theme: 'Base:gradients',
legend: {
    position: 'right'
},
series: [{
    type: 'pie',
    field: 'candidateCount',
    showInLegend: true,
    label: {
        field: 'name',
        contrast: true,
        font: '18px Arial'
    }
}]
为什么会出现这些警告?尽管我已经提到了所有必要的值,但目前还没有绘制图表


请帮助…

您使用了一个字符串来定义存储,但它需要一个存储对象。 2种解决方案:

1)
store:Ext.getCmp('CandidateDistribution'),

或者2)通过以下方式将存储定义为变量
chartStore=Ext.create('Ext.data.store',{…})然后将其传递到图表配置:
store:chartStore


但根据错误,也许这不是问题所在。。。您可以发布门店代码、模型和图表容器吗?

确保至少有一个值不为空或不为零。如果全部为零或null,则会出现此类错误

这就是模型。我加上了回报,效果很好。这是一个快速解决方案

{name: 'HD', type: 'number', convert: function(value,record){
 if (value == 0)
     return 0.0001 // The graphic needs at least one of the values to be more than 0 or will throw an error.
  else     
     return value;
  }
},