PDA

View Full Version : Pie Legend "Undefined"



ben.gillis
5 Jun 2012, 11:23 AM
Why am I getting "undefined" for my pie chart legend items, although I'm as close as I can be to the pie chart example in the documentation. (My only diference is an explicit theme and my data source, a key/value pair vs. 'name', 'data1').

Here's my data store:


var dataStore = Ext.create('Ext.data.JsonStore', {
fields: ['Key', 'Value'],
data: Data
});


and, here's my items:


var items = {
xtype: 'chart',
theme: 'MyTheme',
style: 'background:#FFFFFF',
animate: true,
store: dataStore,
shadow: true,
insetPadding: 4,
legend: {
position: 'left',
labelFont: '0.5em Arial'
},
series: [{
type: 'pie',
field: 'Value',
showInLegend: true,
donut: false,
tips: {
trackMouse: true,
width: 240,
height: 28,
renderer: function (storeItem, item) {
this.setTitle(storeItem.data.Key + ': ' + Ext.util.Format.number(storeItem.data.Value, '0,0') + ' GB (' + Math.round(storeItem.data.Value / totalStorage * 100) + '% of ' + Ext.util.Format.number(totalStorage, '0,0') + ' GB)');
}
},
highlight: {
segment: {
margin: 10
}
}
}]
}

mitchellsimoens
7 Jun 2012, 1:44 PM
What Ext JS 4 version?

ben.gillis
26 Jun 2012, 12:32 PM
Good question. The version isn't in the .js headers.

How can I tell?

Thanks,
Ben