2013-08-27 53 views
1

我在用2.0rc1創建拉力餅圖時遇到問題。 當我內chartConfig添加chartData它工作正常(樣本格式如下所示)中,當相同的系列內「prepareChartData」加入鑑於它拋出錯誤:用2.0rc1創建拉力餅圖

"No data was returned by the calculator aggregation provided"

樣本系列數據:

series: [ 
    { 
     type: 'pie', 
     data: [ ['Defects', 4], ['Feature A', 4], ['Feature B', 4] ] 
    } 
] 

當添加上述內chartConfig系列它工作正常(樣本格式如下所示):

chartConfig: { 
    ……. 
    ………. 
    chartData: { 
     …… 
     …………… 
     series: [ 
       { 
        type: 'pie', 
        data: [ ['Defects', 4], ['Feature A', 4], ['Feature B', 4] ] 
       } 
     ] 
    } 
} 

當同一系列內「製備添加而areChartData」它拋出錯誤:」無數據被提供的計算器聚合返回「(樣本格式如下所示)

prepareChartData: function(store) { 
    return { 
     series: [ 
      { 
       type: 'pie', 
       data: [ ['Defects', 4], ['Feature A', 4], ['Feature B', 4] ] 
      } 
     ] 
    } 
} 

回答

0

這在2.0rc1圖表組件的缺陷。它錯誤地試圖確定圖表中是否有任何數據。如果它包含在您的應用程序創建的圖表前

下面的代碼應該工作:

Ext.define('Rally.ui.chart.ChartFix', { 
    override: 'Rally.ui.chart.Chart', 

    //this function has a bug in it. 
    //for now simply return true 
    _haveDataToRender: function() { 
     return true; 
    } 
}); 

然後簡單地創建圖表,你總是有。

我創建了一個缺陷來跟蹤這個項目。