PDA

View Full Version : Extjs 3.2 piechart categories duplicates



marchoward90
3 Apr 2014, 1:11 AM
I have a piechart which i'm passing in numbers and the category are the numbers. As there are duplicates of the same number e.g. (3,3,7,8,4,5,8,5) I was expecting the categories to show as (3,7,8,4,5) rather than each individual number from the store. Do i need to set a property?

mitchellsimoens
8 Apr 2014, 4:16 AM
Sounds like the store and response aren't setup properly. Got a test case I can run?

marchoward90
24 Apr 2014, 7:37 AM
I have included my code for the store, array reader and chart. There are lots more entries in the store but i thought i'd keep it simple for you. Thanks.


Ext.grid.dummydata = [
['Aviva Growth Fund of Funds S2 Pen', 'Aviva Growth Fund of Funds S2 Pen', 'GB00B02GC767', '9/1 12:00am', 6, 58.68, 'Y', 'EUR', 405129.19, 55555, 'Structured Products'],
['Aviva Guaranteed 6 S4 Life', 'Aviva Guaranteed 6 S4 Life', 'GB00B3CMX497', '9/1 12:00am', 3, 58.39, 'Y', 'EUR', 855385.38, 55555, 'Pensions'],
['Aviva Index-Linked Gilt 13 Pen', 'Aviva Index-Linked Gilt 13 Pen', 'GB00B68G4D20', '9/1 12:00am', 5, 66.97, 'Y', 'EUR', 635362.53, 55555, 'VCTs/EIS'],
['Aviva Investors Global High Yield Bond Fund A [USD]', 'Aviva Investors Global High Yield Bond Fund A [USD]', 'LU0367993317', '9/1 12:00am', 4, 21.8, 'Y', 'EUR', 1211850.86, 55555, 'Agricultural property'],
['Aviva Investors Global High Yield Bond Fund Bx [USD]', 'Aviva Investors Global High Yield Bond Fund Bx [USD]', 'LU0562505817', '9/1 12:00am', 4, 63.77, 'Y', 'EUR', 750269.33, 55555, 'Trust assets'],
['Aviva Investors Global High Yield Bond Fund Hedged AX [GBP]', 'Aviva Investors Global High Yield Bond Fund Hedged AX [GBP]', 'LU0397833129', '9/1 12:00am', 4, 35.79, 'Y', 'EUR', 580507.55, 55555, 'Business assets'],
['Aviva Investors Global High Yield Bond Fund I [USD]', 'Aviva Investors Global High Yield Bond Fund I [USD]', 'LU0367993663', '9/1 12:00am', 4, 11.14, 'Y', 'EUR', 1572059.83, 55555, 'Other assets (e.g. Cars, wine, art)'],
['Aviva Investors Global High Yield Bond Fund I Hedge [EUR]', 'Aviva Investors Global High Yield Bond Fund I Hedge [EUR]', 'LU0367993747', '9/1 12:00am', 4, 68.25, 'Y', 'EUR', 371935.62, 55555, 'Trust assets'],
['Aviva Investors Global High Yield Bond Fund Ix [USD]', 'Aviva Investors Global High Yield Bond Fund Ix [USD]', 'LU0650814238', '9/1 12:00am', 4, 43.15, 'Y', 'EUR', 370265.6, 55555, 'Business assets'],
['Aviva Investors Global High Yield Bond Fund IX Hedge [EUR]', 'Aviva Investors Global High Yield Bond Fund IX Hedge [EUR]', 'LU0650813693', '9/1 12:00am', 4, 3.44, 'Y', 'EUR', 1544135.25, 55555, 'Other assets (e.g. Cars, wine, art)']]

var reader = new Ext.data.ArrayReader({
fields: ['asset', 'description', 'isin', 'valuation', 'riskrating', 'riskscore', 'cpr', 'currency', 'currval', 'propval', 'assetcat']
}, [
{ name: 'asset' },
{ name: 'description' },
{ name: 'isin' },
{ name: 'valuation', type: 'date', dateFormat: 'n/j h:ia' },
{ name: 'riskrating', type: 'number' },
{ name: 'riskscore', type: 'float' },
{ name: 'cpr' },
{ name: 'currency' },
{ name: 'currval' },
{ name: 'propval' },
{ name: 'assetcat' }
]);


var store = new Ext.data.Store({
reader: reader,
data: xg.dummyData
});
new Ext.Panel({
items:[{
xtype: 'piechart',
dataField: 'riskrating',
categoryField: 'label',
style: {
float: 'left'
},
series: [{
style: {
colors: ["#818A8F", "#FFE075", "#006084", "#BDE3DC", "#006964", "#289A82", "#89774D"]
}
}]
}]