PDA

View Full Version : extjs line chart inside a window not rendering



jdkhamba
10 May 2013, 10:34 AM
Hi,

I am using ExtJS version 3.2.1 with the latest google chrome version :



Google Chrome
26.0.1410.64 (Official Build 193017) m


OS
Windows


WebKit
537.31 (@147513)


JavaScript
V8 3.16.14.11


Flash
11.7.700.179


User Agent
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31








My chart_url points to : http://yui.yahooapis.com/2.8.0/build/charts/assets/charts.swf
(http://yui.yahooapis.com/2.8.0/build/charts/assets/charts.swf)
I am trying out the simple chart example shown here:
http://trac.geoext.org/browser/ext/3.2.1/examples/chart/charts.js?rev=2155
(http://trac.geoext.org/browser/ext/3.2.1/examples/chart/charts.js?rev=2155)I just added an extra line to host the panel inside a Ext.Window like this :



var store = new Ext.data.JsonStore({
fields: ['name', 'visits', 'views'],
data: [
{ name: 'Jul 07', visits: 245000, views: 3000000 },
{ name: 'Aug 07', visits: 240000, views: 3500000 },
{ name: 'Sep 07', visits: 355000, views: 4000000 },
{ name: 'Oct 07', visits: 375000, views: 4200000 },
{ name: 'Nov 07', visits: 490000, views: 4500000 },
{ name: 'Dec 07', visits: 495000, views: 5800000 },
{ name: 'Jan 08', visits: 520000, views: 6000000 },
{ name: 'Feb 08', visits: 620000, views: 7500000 }
]
});


// extra extra simple
var pan = new Ext.Panel({
title: 'ExtJS.com Visits Trend, 2007/2008 (No styling)',
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'));
}
}
}
});
var win = new Ext.Window({ items: pan, layout: 'fit', width: 500, height: 300}).show();



But all I am getting is the window with the title but no chart being displayed inside it:

43707

Any idea where I could be going wrong?

Thanks.

mitchellsimoens
13 May 2013, 7:59 AM
Try using the charts.swf that comes with the framework.

jdkhamba
13 May 2013, 10:02 AM
That works! Thanks :-)