2014-03-27 1 views
0

센차 터치 2.3.1 cmd를 getShowInLegend 없다 : 4.0.XX센차 터치 오류 : 개체가 어떤 방법

이 차트를 그릴려고 할 때

내 센차 터치 차트 응용 프로그램이 오류가 발생합니다 :

Uncaught TypeError: Object [object Object] has no method 'getShowInLegend' AbstractChart.js?_dc=1395914109534:649
Ext.define.refreshLegendStore AbstractChart.js?_dc=1395914109534:649
Ext.define.updateSeries AbstractChart.js?_dc=1395914109534:877
setter 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 Component.js?_dc=1395914109519:100
Base.implement.callSuper sencha-touch-all-debug.js:4735
Ext.define.constructor AbstractChart.js?_dc=1395914109534:626
Class sencha-touch-all-debug.js:5208
(anonymous function) 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
(anonymous function) sencha-touch-all-debug.js:5516
Ext.define.applyActiveItem sencha-touch-all-debug.js:33208
(anonymous function) 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
(anonymous function) 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
(anonymous function) 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
(anonymous function) 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
(anonymous function) 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
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
(anonymous function)

을 차트가이 뷰에 렌더링됩니다.

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 파일을 사용하여 추가됩니다. 코드는 다음과 같습니다 : 나는 과연,이 함수를 호출하고, AbstractChart.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); 
            } 

. 내 전체 디렉토리 (inc/app 및/src)를 검색했지만 기능을 찾을 수 없습니다.

'Ext.chart.AbstractChart'가 필요로하고 확장하는 모든 파일을 업데이트했지만 여전히 오류가 발생합니다.

어떤 사람이 함수가 속한 클래스인지 알려 주시면 docs.sencha.com에서 업데이트하거나이 오류를 해결하는 방법을 알려줍니다.

+0

차트보기의 코드를 제공하십시오. –

+0

@ SujataChanda : 더 많은 코드가 추가되었습니다 –

+0

차트가 어디에 있습니까? –

답변

0

질문에 대한 귀하의 "시리즈"는 AbstractChart에 정의되어 있습니다. 귀하의 차트는 AbstractChart를 확장하므로 필요를 추가 할 필요가 없습니다 (AbstractChart). getSeries 메소드는 sencha-touch 코어에 의해 생성됩니다. Ext.base를 확장하는 객체의 모든 필드에는 get [MyField]가 있고 [MyField]가 설정됩니다.

this 기능에 오류가 있습니다. getShowInLegend를 시도 할 때. 그러나 Series의 각 항목에는 getShowInLegend 메서드가 있습니다. hereshowInLegend: true, 행에 있는지 확인할 수 있습니다.

첫 번째 줄에서 말했듯이 Ext.base를 확장하는 모든 객체에는 get [MyField] 메서드가 있고 Ext-chart-series-Series은 Ext.base로 확장됩니다.

이 정보를 사용하면 차트를 작성하는 데 다소 오해가있을 것입니다. 그러나 우리는 당신의 chartgx가 어떻게 창조되는지 enogh 정보를 가지고 있지 않습니다. Ext.create를 사용 했습니까?