1
ext-all-sandbox.jsを使用して既存のExt3アプリケーションにExt4チャートを追加しようとしています。私は基礎が働いているが、下のコードはaxis.processView is not a function
を与える。定義された軸がなくてもうまく動作します(ただし軸は明白です)。ExtJS 3アプリケーションでExtJS 4グラフを使用する
実際の軸インスタンスを作成する代わりに、configオブジェクトが直接使用されているようです。これを実現するソリューションはありますか?ソースをざっと見た後
TestGraphPanel = Ext.extend(Ext.Panel, {
initComponent: function() {
TestGraphPanel.superclass.initComponent.call(this);
Ext4.define('DataPoint', {
extend: 'Ext.data.Model',
fields: ['xValue', 'yValue']
});
this.store = Ext4.create('Ext.data.Store', {
model: 'DataPoint',
data: [
{xValue: 0, yValue: 2},
{xValue: 1, yValue: 4},
{xValue: 2, yValue: 7},
{xValue: 3, yValue: 5},
{xValue: 4, yValue: 8},
{xValue: 5, yValue: 9}
]
});
},
afterRender: function() {
Ext4.create('Ext.chart.Chart', {
renderTo: this.body.dom,
width: this.ownerCt.getWidth(),
height: this.ownerCt.getHeight(),
store: this.store,
axes: [
{
title: 'x',
type: 'Numeric',
postition: 'bottom',
fields: ['xValue']
},
{
title: 'y',
type: 'Numeric',
position: 'left',
fields: ['yValue']
}
],
series: [
{
type: 'line',
xField: 'xValue',
yField: 'yValue'
}
]
});
}
});
あなたはチャートを作成し、afterRender?でchart.render()をコールするだけです。 – OrangeDog
あなたはrenderToを設定しているので、明示的にrenderを呼び出す必要はないと思いますが、基本的にはyesです。 – Jad
レンダリングは必ず削除する必要があります。それ以外の場合は、divが存在する前にレンダリングを試みます。 – OrangeDog