这是代码。它在从“Ext.define.Rally.loadScripts”启动的“Ext.define.initComponent”内因“Uncaught TypeError: Cannot read property 'parentNode' of null”而崩溃。永远不会到达 _drawChart():
我还在 rake 脚本中添加了以下行以引用 google API:
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
这是 App.js:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
//Write app code here
google.load("visualization", "1.0", {packages:["corechart"]});
google.setOnLoadCallback(this._drawChart);
},
_drawChart: function() {
var chartContainer = this.down('#chartContainer').getEl().dom;
var chart = new google.visualization.BarChart(chartContainer);
var graphArray = [['Module', 'Payload Code', 'Test Code']];
chartData = google.visualization.arrayToDataTable(graphArray);
chart.draw(chartData, {width: 700, height: 500});
}
});