2014-03-19 4 views
0

아침,엽차 차트되지 않은 유형 오류 : [개체 개체]있는 방법 'getDirection로'

내가 4.0.2.67

불행하게도, 나는에 대해 충분히 모른다 센차 터치 2.3, 엽차 cmd를 사용하고이 없습니다 Sencha는 내 문제를 설명하고 진단 할 수 있으므로 누락 된 부분은 용서해주십시오.

나는 어떤 차트가 그려되기 전에, 응용 프로그램 충돌을 여러 게이지 및 막대 차트를 만들어 내 응용 프로그램을 실행하고 다음과 같은 오류 메시지가 줄 CONSOLE.LOG 때 :

Uncaught TypeError: Object [object Object] has no method 'getDirection'

그것을 나는 axis.Axis.js을 확인했다

for (i = 0, ln = axes.length; i < ln; i++) { axis = axes[i]; if (!directionMap[axis.getDirection()]) {// <-- line 683 directionMap[axis.getDirection()] = [axis]; } else { directionMap[axis.getDirection()].push(axis); } }

: (이 상자에서 나온 방법이있다) 오류가 라인과 같습니다 chart.series.Series.js, 683에 말한다 그리고 나 (543)는 다음을 가지고 그 라인을 볼 수 Class {titleStyle: Class, labelStyle: Class, gridStyle: Class, initConfig: function, initialConfig: Object…} _chart: Class _fields: Array[0] _labels: Array[0] _margin: 10 _maximum: 10 _minimum: 0 _position: "gauge" _steps: 10 _title: false axisId: "ext-axis-12" config: objectClass eventDispatcher: Class getEventDispatcher: function() { getObservableId: function() { getUniqueId: function() { gridStyle: Class id: "ext-chart-axis-gauge-1" initConfig: function(){} initialConfig: Object labelStyle: Class managedListeners: Object observableId: "#ext-chart-axis-gauge-1" titleStyle: Class usedSelectors: Array[1] __proto__: Object

내 애플 게이지 및 막대 차트를 모두 생성
getDirection: function() { return this.getChart().getDirectionForAxis(this.getPosition()); },

console.log(axes[i])는 다음을 보여줍니다. 게이지를 비활성화하면 더 이상이 오류가 발생하지 않습니다. 그래서 문제는 제 게이지를 만드는 기능에 있습니다. 여기에 있습니다 :

var gaugeTitle = thetabs[tt].Entries[tt2].Title; 
var currentValue = (thetabs[tt].Entries[tt2].CurrentValue > 0)?thetabs[tt].Entries[tt2].CurrentValue:0; 
var baseValue = thetabs[tt].Entries[tt2].BaseValue; 
var centreValue = thetabs[tt].Entries[tt2].CentreValue; 
var generated = thetabs[tt].Entries[tt2].Generated; 
var gaugeData = thetabs[tt].Entries[tt2];// this data populates the gauge store 

// now we create a store for the gauge 
var gaugeStore = Ext.create('Ext.data.Store', { 
storeId: 'gaugeStore', 
fields: [{'name':'BaseValue','type':'int'}, 
{'name':'CentreValue','type':'int'}, 
{'name':'CurrentValue','type':'int'}, 
{'name':'Generated'}, 
{'name':'Title'}, 
{'name':'Type'}], 
data: gaugeData 
}); 

gaugeStore.setData(gaugeData); // Use the add function to add records or model instances. 

// set the maximum value on the gauge, then round it to whole number  
var gaugemax = (thetabs[tt].Entries[tt2].CentreValue>10)? thetabs[tt].Entries[tt2].CentreValue*2:10; 

// ensure gauge max is never less than currentValue 
if(gaugemax < currentValue){ 
gaugemax = currentValue+(currentValue*.1); // use 110% of currentValue 
} 
// show whole numbers only 
gaugemax = Math.round(gaugemax/10)*10; 

//set gauge colour 
gaugeColor = setGaugeColour(siteName); 

/// new gauge 
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 
}], 

series: [{ 
type: 'gauge', 
minimum: 0, 
maximum: gaugemax, 
steps: 10, 
margin: 10, 
angleField: 'CurrentValue', 
donut: 30, 
colorSet:[gaugeColor,'#e1e1e1'] 
}] 
}; 


          ` 

수정 방법을 알려주십시오.

답변

0

계기에서 축을 제거하면이 문제가 해결 된 것으로 보이지만 지금은 다른 것으로 표시됩니다 .-- (