PDA

View Full Version : Please help me in Ext JS4 Graph



manjush.kochi
29 Oct 2011, 7:09 AM
var submit=function(){
var id=Ext.getCmp('txtID').getValue();
ReportsDWR.graphFetchVisitID(id,callback = function(list){
//ldetails=list;
alert(list);
store.loadData(list);

}); }

var store = new Ext.data.ArrayStore({

fields:[{name:'name',type:'date',dateFormat: 'm/d/Y'},{name:'data1',type: 'float' }]
});


var ldetails = [];
var myReader = new Ext.data.ArrayReader( {}, [
{
name :'name',
type: 'date',
dateFormat: 'm/d/Y'
},

{
name:'data1',
type: 'float'

}

]);




var chartdemo=Ext.create('Ext.chart.Chart', {
renderTo: Ext.getBody(),
width: 1000,
height: 600,
id :'chartdemo',
animate: true,
store :store,
axes: [
{
type: 'Numeric',
position: 'left',
fields: ['data1'],
label: {
renderer: Ext.util.Format.numberRenderer('0,0')
},
title: 'BMI Values',
grid: true,
minimum: 0
},
{
type: 'Category',
position: 'bottom',
fields: ['name'],
label: {
renderer: Ext.util.Format.dateRenderer('m/d/Y ')
},
title: 'Date'
}
],
series: [
{
type: 'line',
highlight: {
size: 7,
radius: 7
},
axis: 'left',

xField: 'name',
yField: 'data1',
markerConfig: {
type: 'cross',
size: 4,
radius: 4,
'stroke-width': 0
}
}

]

});
in this case the data is loaded from An Arraylist in Dwr and its called back in ext JS and that list is loaded in Store .But in this case it dosent work,Y axis is not completely shown,Can Anyone please help me in using Json Store to load data from a list,and please check my code..please

manjush.kochi
1 Nov 2011, 3:53 AM
:((:((:((:((
Didnt received any help