alex9311
4 Sep 2012, 3:10 PM
Hi everyone, so I have a store:
Ext.define('AM.store.Users', {
extend: 'Ext.data.Store',
model: 'AM.model.User',
data: [
{Name: 'derp', Grade: 'FR'},
{Name: 'herp', Grade: 'SR'},
....
{Name: 'beavis', Grade: 'SR'}
]
});
And a chart:
Ext.define('AM.view.user.Chart' , {
extend: 'Ext.chart.Chart',
alias: 'widget.userchart',
...(basic config stuff)...
series: [{
type: 'pie',
//categoryField: 'Level',
angleField: 'Level',
showInLegend: true,
}]
//put functions here to analyze store?
});
I want the pie chart to show the grade-level distribution in my store. Do I have to write functions that analyze the store and pass new values to the pi chart? If so, where would I stick those functions in MVC architecture? Sorry if this question is too broad, I'm a beginner in extjs
Ext.define('AM.store.Users', {
extend: 'Ext.data.Store',
model: 'AM.model.User',
data: [
{Name: 'derp', Grade: 'FR'},
{Name: 'herp', Grade: 'SR'},
....
{Name: 'beavis', Grade: 'SR'}
]
});
And a chart:
Ext.define('AM.view.user.Chart' , {
extend: 'Ext.chart.Chart',
alias: 'widget.userchart',
...(basic config stuff)...
series: [{
type: 'pie',
//categoryField: 'Level',
angleField: 'Level',
showInLegend: true,
}]
//put functions here to analyze store?
});
I want the pie chart to show the grade-level distribution in my store. Do I have to write functions that analyze the store and pass new values to the pi chart? If so, where would I stick those functions in MVC architecture? Sorry if this question is too broad, I'm a beginner in extjs