0
votes

I have in a tabPanel a list from a Store who's based on the Model below. In the second tab I want a pie-chart (build with Sencha Charts 2.0 Beta) with the total number of three possible values of my vote field (values can be "Yes", "No" or "AB", so what I expect is three pie-parts).

The Store grouper function group the store by name first character for the list.

groupFn: function(record) {                
            return record.get('name')[0].toUpperCase();                        
        }

I thought about creating a new Store dynamically BUT the number of data is very large (~31k rows in DB) so if i can handle with the Store I already have it would be great.

Model :

{
  name : 'someName',
  vote : 'someVote',
  ID   : 'someID'
}

Hope I give all the informations.

Thank you in advance for any help.

1

1 Answers

0
votes

OK update, now I have the total number for each vote result. I used the following code :

var store = Ext.getCmp('myList').getStore();                            
store.findBy(function(rec) {
        if (rec.get('vote') === 'YES') {
              countYES++;
           } 
});

I'm trying to use those data in my pie chart now.