PDA

View Full Version : [3.0] Pie Chart issues



arthurakay
22 Apr 2009, 10:53 AM
I'm having issues trying to get the Pie Charts to work. If I declare the chart in-line as an xtype, things work just fine:



...
items: [
{
xtype: 'piechart',
categoryField: 'testResult',
dataField: 'testResult',
height: 200,
style: {
legend: {
display: 'right'
}
},
store: Ext.ux.UnitTest.Store,
url: 'ext-3.0-rc1/resources/charts.swf',
width: 200
}
]
...


But if I try to declare the object ahead of time, it doesn't render:


Ext.ux.UnitTest.Chart = new Ext.chart.PieChart({
categoryField: 'testResult',
dataField: 'testResult',
height: 200,
style: {
legend: {
display: 'right'
}
},
store: Ext.ux.UnitTest.Store,
url: 'ext-3.0-rc1/resources/charts.swf',
width: 200
});

...
items: [
Ext.ux.UnitTest.Chart
]
...



Does anyone have an idea about what I'm missing? Since Ext.chart.PieChart inherits from Ext.Component, shouldn't it just render with it's parent (like it doesn when declared in-line)?

arthurakay
22 Apr 2009, 10:55 AM
Also, the legend doesn't appear. According to the YUI docs, I've declared it correctly - but I don't know how that translates through the Ext extension.

shibubh
22 Apr 2009, 6:33 PM
but works for me
take a look

http://ny504427.bizhostnet.com/Default.aspx

Lonely Wolf
8 May 2009, 3:44 PM
Also, the legend doesn't appear. According to the YUI docs, I've declared it correctly - but I don't know how that translates through the Ext extension.
Also I would like to know the legend exist? And how can it be used?

RamsesAkaPus
29 May 2009, 3:57 AM
Also, the legend doesn't appear. According to the YUI docs, I've declared it correctly - but I don't know how that translates through the Ext extension.

use chartStyle rather then style parameter; it works\:D/