hi,
i have been trying to dynamicaly create multiple lin in a extjs 4 char through a json without success...
as u can see in the code below ..
the model and store data will have to be changed ..
i really don't see how it could be done...
basically the user can choose any number of customer which will return a json that will be use to create the line ..
any help is welcome...
var store = new Ext.data.ArrayStore({
id: 'graphStore',
autoLoad: true,
proxy: new Ext.data.HttpProxy({
type: 'ajax',
method: 'GET',
url: 'data/resources/jsons/graph.json',
//url: 'data/resources/jsons/graphNested.json',
//url: '../Services/NukeappsSiteWebService.asmx/GetJsonStructure',
reader: {
type: 'json',
root: 'data'
}
}),
fields: [
{ name: 'visits', type: 'int' },
{ name: 'month', type: 'string' }

],

listeners: {

beforeload: function (store, operation, opts) {
currentCount++;
operation.params = {
currentCount: currentCount
};
},

load: function (store, records) {
for (var i = 0; i < records.length; i++) {
var visits = records[i].get('visits');
visitsRecord = records.length;
this.visit = records.length;
console.log(visits);
if (i == records.length - 1) console.log(visitsRecord);
}
}
}
});
console.log('number of visits --> ' + this.visit);

me.lineChart = Ext.create('Ext.chart.Chart', {
style: 'background:#fff',
animate: true,
store: store,
shadow: true,

axes: [{
type: 'Numeric',
minimum: 0,
position: 'left',
fields: ['visits'],
title: 'Number of Visits',
minorTickSteps: 1
}, {
type: 'Category',
position: 'bottom',
fields: ['month'],
title: 'Month of the Year'
}],
series: [{
type: 'line',
highlight: {
size: 7,
radius: 7
},
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function (storeItem, item) {
this.setTitle(storeItem.get('month') + ': ' + storeItem.
get('visits') + ' visits');
}
},
axis: 'left',
xField: 'month',
yField: 'visits'
}]
});