【发布时间】:2013-05-27 15:28:11
【问题描述】:
我正在尝试将图表添加到我的 Sencha Touch 应用程序中。
我添加了一个这样的视图,并插入了一个图表,我在几个网站上看到它:
Ext.define('dergraph.view.Graph', {
extend: 'Ext.Container',
xtype: 'graph',
requires: [
'Ext.TitleBar'
],
config: {
tabBarPosition: 'bottom',
layout: 'fit',
items: [
{
xtype: 'chart',
animate: true,
store: 'dergraph.store.PhoneBook',
legend: {
position: 'right'
},
axes: [{
type: 'Category',
fields: ['firstName'],
position: 'bottom', //x-axis
title: 'Category'
}, {
type: 'Numeric',
fields: ['value'],
position: 'left', //y-axis
title: 'Value'
}]
}
]
}
});
但现在我在浏览器的控制台中遇到错误:未捕获错误:[Ext.createByAlias] 无法创建无法识别别名的实例:axis.Category。
这是我在 app.js 中需要的部分:
requires: [
'Ext.MessageBox',
'Ext.dataview.List',
'Ext.chart.Chart',
'Ext.chart.axis.Numeric',
'Ext.chart.axis.Category'
],
有人可以帮我解决这个问题吗?
【问题讨论】: