PDA

View Full Version : Flash problem with Ext.chart



dverkade
14 Aug 2009, 6:53 AM
Hi!

I've been trying to get an Ext chart running, but I've run into a problem with the flash. Flash comes up with the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.yahoo.astra.fl.charts.axes::CategoryAxis/::getCategoryNames()
at com.yahoo.astra.fl.charts.axes::CategoryAxis/::autoDetectCategories()
at com.yahoo.astra.fl.charts.axes::CategoryAxis/updateScale()
at com.yahoo.astra.fl.charts::CartesianChart/com.yahoo.astra.fl.charts:CartesianChart::updateAxisScalesAndBounds()
at com.yahoo.astra.fl.charts::CartesianChart/com.yahoo.astra.fl.charts:CartesianChart::drawAxes()
at com.yahoo.astra.fl.charts::CartesianChart/com.yahoo.astra.fl.charts:CartesianChart::draw()
at fl.core::UIComponent/drawNow()
at Charts/setDataProvider()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at ()
at flash.external::ExternalInterface$/flash.external:ExternalInterface::_callIn()
at ()

I use the following Ext JS code:



Ext.onReady(function(){

var store = new Ext.data.JsonStore({
"url":"json.data","autoLoad":true,"reader":new Ext.data.JsonReader({"root":"items"})
});



// extra extra simple
new Ext.Panel({
title: 'ExtJS.com Visits Trend, 2007/2008 (No styling)',
renderTo: 'container',
width:500,
height:300,
layout:'fit',

items: {
xtype: 'linechart',
store: store,
xField: 'name',
yField: 'visits',
listeners: {
itemclick: function(o){
var rec = store.getAt(o.index);
Ext.example.msg('Item Selected', 'You chose {0}.', rec.get('name'));
}
}
}
});
});


And it loads the following JSON data:


{"metaData":{"fields":["date","visits"],"root":"items","totalProperty":"totalcount"},"items":[{"date":"01","visits":18},{"date":"02","visits":22},{"date":"03","visits":5},{"date":"04","visits":1},{"date":"05","visits":4},{"date":"06","visits":15},{"date":"07","visits":7},{"date":"08","visits":15},{"date":"09","visits":17},{"date":10,"visits":6},{"date":11,"visits":5},{"date":12,"visits":3},{"date":13,"visits":14},{"date":14,"visits":10},{"date":15,"visits":8},{"date":16,"visits":9},{"date":17,"visits":2},{"date":18,"visits":1},{"date":19,"visits":3},{"date":20,"visits":6},{"date":21,"visits":12},{"date":22,"visits":10},{"date":23,"visits":7},{"date":24,"visits":5},{"date":25,"visits":1},{"date":26,"visits":3},{"date":27,"visits":8},{"date":28,"visits":6},{"date":29,"visits":2},{"date":30,"visits":6},{"date":31,"visits":3}],"totalcount":31}


Anyone have an idea why this throws an flash error? Thanks!