我正在学习ExtJs-4。
我不得不在面板上创建图表条。
这是来自Ext官方网站的相同代码。
这是我的面板,其中包含创建图表、模型和存储的代码。
Ext.define("park.view.mainPanel",{
extend:'Ext.panel.Panel',
alias: 'widget.mainPanel',
title: 'edit User',
initComponent: function(){
Ext.define('WeatherPoint', {
extend: 'Ext.data.Model',
fields: ['temperature', 'date']
});
var store = Ext.create('Ext.data.Store', {
model: 'WeatherPoint',
data: [
{ temperature: 58, date: new Date(2011, 1, 1, 8) },
{ temperature: 63, date: new Date(2011, 1, 1, 9) },
{ temperature: 73, date: new Date(2011, 1, 1, 10) },
{ temperature: 78, date: new Date(2011, 1, 1, 11) },
{ temperature: 81, date: new Date(2011, 1, 1, 12) }
]
});
var chart = Ext.create('Ext.chart.Chart', {
store: store,
theme: 'Category1',
});
this.callParent(arguments);
}
});如果有人知道这一点,这应该很容易。但是像我这样的noobie很难解决。
发布于 2013-01-15 22:55:20
您应该将chart添加为您的面板子项。尝试在this.callParent(arguments);之前添加this.items = [chart];
发布于 2013-05-28 01:26:13
您的图表定义中缺少图表轴和系列。
https://stackoverflow.com/questions/14334500
复制相似问题