0
動的なデータを含むチャートを生成するために3倍になります。 obtaに私が欲しいExtjs 4.2動的なデータを含むグループ化された棒グラフ
MODEL
Ext.define('App.mdlGraficaDE', {
extend: 'Ext.data.Model',
fields: [
]
});
STORE
Ext.define('App.strGraficaDE', {
extend: 'Ext.data.Store',
model: 'App.mdlGraficaDE',
autoLoad: false,
proxy: {
type: 'ajax',
api: {
read: './data/php/Tmc_GraficaDE.php'
},
reader: {
type: 'json',
root: 'data',
totalProperty: 'total'
}
}
});
チャートオブジェクトビューで
var almacenGraficaDE = Ext.create('App.strGraficaDE');
var graficaDE = Ext.create('Ext.chart.Chart',{
style: 'background:#fff',
itemId:'graficaDE',
margin:'10 10 10 10',
animate: true,
shadow: true,
store: almacenGraficaDE,
legend: {
position: 'right'
},
axes:[
{
type:'Category',
position:'bottom',
fields:['Referencia'],
title: 'Referencia'
},
{
type:'Numeric',
position:'left',
fields:[],
minimum:0,
grid:true,
title:'Precio Unitario'
}
],
series:[
{
type: 'column',
axis: 'bottom',
xField:'',
yfield:[]
}
]
});
次の画像のようなもので:
しかし、私はPHPからデータを返す必要がありますどのように知っているドント、と私はstore.loadアクションのコールバックのセクションでいくつかの設定を行う必要がある場合受け取ったデータでチャートの軸とシリーズを設定します。