rallyappsdk2

creating Rally pie chart with 2.0rc1


I am facing problem in creating rally pie chart with 2.0rc1. When I add chartData within chartConfig it works fine(sample format is shown below), Whereas when the same series is added inside “prepareChartData” it throws error:

"No data was returned by the calculator aggregation provided"

Sample series data:

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

When I add above series within chartConfig it works fine(sample format is shown below):

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

Whereas when the same series is added inside “prepareChartData” it throws error : ” No data was returned by the calculator aggregation provided.”(sample format is shown below)

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

Solution

  • This is a defect in the Chart component in 2.0rc1. It's incorrectly trying to determine whether there is any data in the chart.

    The following code should work if it is included in your app before the chart is created:

    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;
        }
    });
    

    Then simply create your chart as you always have.

    I've created a defect to track this item.