Sencha Touch 2.3.1 Cmd: 4.0.XX
我的 Sencha Touch Charts 应用程序在尝试绘制图表时抛出此错误:
未捕获的类型错误:对象 [object Object] 没有方法 'getShowInLegend' AbstractChart.js?_dc=1395914109534:649
Ext.define.refreshLegendStore AbstractChart.js?_dc=1395914109534:649
Ext.define.updateSeries AbstractChart.js?_dc=1395914109534: 877
设置器 sencha-touch-all-debug.js:5491
Base.implement.initConfig sencha-touch-all-debug.js:4920
Ext.define.constructor sencha-touch-all-debug.js:22651
Base.implement.callParent sencha-touch-all-debug.js:4656
Ext.define.constructor sencha-touch-all-debug.js:32375
Base.implement.callSuper sencha-touch-all-debug.js:4735
Ext.define.constructor 组件。 js?_dc=1395914109519:100
Base.implement.callSuper sencha-touch-all-debug.js:4735
Ext.define.constructor AbstractChart.js?_dc=1395914109534:626
类 sencha-touch-all-debug.js:5208
(匿名函数) VM14212:3
Ext.ClassManager.instantiate sencha-touch-all-debug.js:6936
Ext .ClassManager.instantiateByAlias sencha-touch-all-debug.js:6848
Ext.apply.factory sencha-touch-all-debug.js:9980
Ext.define.factoryItem sencha-touch-all-debug.js:32637
Ext.define .add sencha-touch-all-debug.js:32714
Ext.define.applyItems sencha-touch-all-debug.js:32538
setter sencha-touch-all-debug.js:5482
(匿名函数) sencha-touch-all -debug.js:5516
Ext.define.applyActiveItem sencha-touch-all-debug.js:33208
(匿名函数) sencha-touch-all-debug.js:16565
Base.implement.initConfig sencha-touch-all-debug.js:4920
Ext.define.constructor sencha-touch-all-debug.js:22651
Base.implement.callParent sencha-touch-all-debug.js:4656
Ext. define.constructor sencha-touch-all-debug.js:32375
Class sencha-touch-all-debug.js:5208
(匿名函数) VM14212:3
Ext.ClassManager.instantiate sencha-touch-all-debug.js:6936
Ext .ClassManager.instantiateByAlias sencha-touch-all-debug.js:6848
Ext.apply.factory sencha-touch-all-debug.js:9980
Ext.define.factoryItemWithDefaults sencha-touch-all-debug.js:32683
Ext.define .add sencha-touch-all-debug.js:32707
Ext.define.applyItems sencha-touch-all-debug.js:32538
setter sencha-touch-all-debug.js:5482
(匿名函数) sencha-touch-all-debug.js:5516
Ext.define.applyActiveItem sencha-touch-all-debug.js:33208
Base.implement.callParent sencha- touch-all-debug.js:4656
Ext.define.applyActiveItem sencha-touch-all-debug.js:46269
(匿名函数) sencha-touch-all-debug.js:16565
Base.implement.initConfig sencha-touch-all -debug.js:4920
Ext.define.constructor sencha-touch-all-debug.js:22651
Base.implement.callParent sencha-touch-all-debug.js:4656
Ext.define.constructor sencha-touch-all-debug .js:32375
类 sencha-touch-all-debug.js:5208
(匿名函数)VM14212:3
Ext.ClassManager.instantiate sencha-touch-all-debug.js:6936
Ext.ClassManager.instantiateByAlias sencha-touch-all-debug.js:6848
Ext.apply.factory sencha-touch-all-debug.js:9980
分机。 define.factoryItem sencha-touch-all-debug.js:32637
Ext.define.add sencha-touch-all-debug.js:32714
doCharts doCharts.js:394
Ext.Ajax.request.success standardFunctions.js:166
Ext. apply.callback sencha-touch-all-debug.js:10268
Ext.define.onComplete sencha-touch-all-debug.js:35765 Ext.define.onStateChange
sencha-touch-all-debug.js:35709
(匿名函数)
图表呈现到此视图:
Ext.define('dashboards.view.Main', {
extend: 'Ext.Panel',
requires: [
'Ext.chart.*',
'Ext.draw.sprite.Sector',
'Ext.chart.Chart',
'Ext.chart.series.Column',
'Ext.chart.AbstractChart',
'Ext.chart.SpaceFillingChart',
'Ext.dataview.component.Container',
'Ext.chart.series.Series',
'Ext.chart.series.Gauge',
'Ext.carousel.Indicator',
'Ext.carousel.Infinite',
'Ext.carousel.Item',
'Ext.carousel.Carousel',
'Ext.fx.easing.EaseOut',
'Ext.util.TranslatableGroup',
'Ext.chart.series.Cartesian',
'Ext.chart.series.Area',
'Ext.chart.Label',
'Ext.chart.Highlight',
'Ext.chart.Callout',
'Ext.chart.Transformable',
'Ext.chart.series.ItemEvents',
'Ext.chart.theme.Style',
'Ext.draw.Color',
'Ext.chart.series.Bar',
'Ext.chart.series.Column',
'Ext.chart.axis.Gauge',
'Ext.chart.theme.Base',
'Ext.chart.theme.Base',
'Ext.chart.theme.TitleStyle',
'Ext.chart.theme.GridStyle',
'Ext.chart.Toolbar',
'Ext.chart.legend.View',
'Ext.chart.Legend',
'Ext.chart.axis.Numeric',
'Ext.chart.axis.Category',
'Ext.draw.Surface',
'Ext.draw.Draw',
'Ext.draw.Matrix',
'Ext.draw.engine.Canvas',
'Ext.draw.CompositeSprite',
'Ext.fx.Frame',
'Ext.draw.Sprite',
'Ext.fx.Sprite',
'Ext.draw.sprite.Sector',
'Ext.draw.sprite.Rect',
'Ext.chart.interactions.Abstract',
'Ext.chart.axis.Axis',
'Ext.chart.axis.Abstract',
'Ext.util.SizeMonitor',
'Ext.chart.grid.HorizontalGrid','Ext.chart.grid.VerticalGrid','Ext.draw.fx.TimingFunctions','Ext.Container','Ext.TitleBar','Ext.data.Store','Ext.data.StoreManager'
],
alias: 'widget.mainview',
id: 'mainpage',
getSlideLeftTransition: function () {
return { type: 'slide', direction: 'left' };
},
getSlideRightTransition: function () {
return { type: 'slide', direction: 'right' };
},
config: {
layout: {
type: 'fit'
},
items: [
{
xtype : 'container',
flex: 1,
id: 'introtext',
html: '<p>Please select from your dashboards above</p>'
},
{
xtype : 'selectfield',
store : companiesStore2,
name : 'companies',
queryMode: 'local',
id : 'companiesSelect',
itemId: 'companySelect',
valueField : 'companyname',
displayField : 'companyname',
style: 'overflow:hidden',
listeners: {
change: function(field,value) {
getStats(value)
}
}
},
{
xtype: 'toolbar',
docked: 'bottom',
id: 'bumtoolbar',
items: []
},
{
layout: {
pack: 'end'
},
xtype: 'titlebar',
id: 'titlebartop',
title: 'axisfirst Dashboards',
docked: 'top',
items: [
{
xtype: 'button',
text: 'Log Off',
itemId: 'logOffButton2',
id: 'logOffButton2',
align: 'right',
cls: 'logoffBtn',
scope: this,
listeners: {
tap: function() {
Ext.Msg.confirm("Log out", "Are you sure you want to logout?", function(btn) {
if (btn === 'yes') {
logout();
//Ext.Viewport.setActiveItem({ xtype: loginview });
} else {
return false;
}
}, this);
}
}
}
]
}]
}
});
该图表是使用单独的 .js 文件添加的。代码如下所示:
var chartgx = {
cls: 'thegauge',
itemId: 'gauge'+tt2,
xtype: 'chart',
shadow: true,
store: gaugeStore,
width : 'auto',
animate: true,
insetPadding: 50,
axes: [{
type: 'gauge',
position: 'gauge',
minimum: 0,
maximum: gaugemax,
steps: 10,
margin: 10,
direction: 'right'
}],
series: [{
showInLegend: false,
type: 'gauge',
position: 'gauge',
minimum: 0,
maximum: gaugemax,
steps: 10,
margin: 10,
angleField: 'CurrentValue',
donut: 30,
colorSet:[gaugeColor,'#e1e1e1']
}]
};
var gaugeText = '<p class="gaugetitle">' + gaugeTitle + ': ' + currentValue + '</p>';
var chartgx2 = Ext.Container({
xtype : 'container',
flex: 1,
layout: 'fit',
cls: 'gaugeContainer',
needle: true,
items: chartgx,
html: gaugeText
});
if (gaugeTitle !== '') {
allcharts.push(chartgx2);
}
我查看了 AbstractChart.js,果然,它正在调用该函数。我搜索了整个目录(inc /app 和 /src),但找不到该函数。
我已经更新了“Ext.chart.AbstractChart”需要和扩展的所有文件,但仍然出现错误。
有人可以告诉我该函数属于哪个类,以便我可以从 docs.sencha.com 更新,或者,告诉我如何纠正这个错误。