2014-09-26 2 views
0

두 개의 Y 축을 가진 샘플 차트를 만들었고 시리즈에 title 속성을 부여한 후에 차트가 손상되었습니다. 시리즈가하는 documentation에 따르면Title 속성이 sencha 차트를 깨뜨림

Error call stack

: 우리는 호출 스택을 보면, 우리는 이것이 updateTitle() 기능에서 일어나는 것을 볼

Uncaught TypeError: Array.prototype.indexOf called on null or undefined

: 그것은 콘솔에 다음과 같은 오류를 제공합니다 title 속성을 가지고 있으면 왜 차트가 손상됩니까?

Ext.application({ 
    name: 'Fiddle', 

    launch: function() { 
     var chart = new Ext.create('Ext.chart.CartesianChart', { 
      renderTo: Ext.getBody(), 
      width: 500, 
      height: 500, 
      legend: { 
       docked: 'bottom' 
      }, 
      "width": 740, 
      "height": 440, 
      "axes": [{ 
       "title": "Month", 
       "type": "category", 
       "position": "bottom", 
      }, { 
       "title": "Reputation", 
       "type": "numeric", 
       "position": "left", 
      }, { 
       "title": "Upvote", 
       "type": "numeric", 
       "position": "right", 
      }], 
      "series": [{ 
       "xField": "name", 
       "yField": "data0", 
       "yAxis": 1, 
       "title": "Reputation gain", 
       "type": "line" 
      }, { 
       "xField": "name", 
       "yField": "data1", 
       "yAxis": 2, 
       "title": "Upvotes", 
       "type": "line" 
      }], 
      "store": { 
       "fields": ["name", "data0", "data1"], 
       "data": [{ 
        "name": "08/14", 
        "data0": 1567, 
        "data1": 2335 
       }, { 
        "name": "09/14", 
        "data0": 1654, 
        "data1": 1246 
       }, { 
        "name": "10/14", 
        "data0": 1777, 
        "data1": 1646 
       }, { 
        "name": "11/14", 
        "data0": 2014, 
        "data1": 1456 
       }, { 
        "name": "12/14", 
        "data0": 2562, 
        "data1": 2321 
       }] 
      } 
     }); 
    } 
}); 

답변

0

당신은 시리즈의 yAxis 재산 전에 title 속성을 배치해야합니다. 따라서 시리즈를 정의하십시오

"series": [{ 
    "title": "Reputation gain",//Have to be placed before yAxis. 
    "xField": "name", 
    "yField": "data0", 
    "yAxis": 1, 
    "type": "line" 
}, { 
    "title": "Upvotes",//Have to be placed before yAxis. 
    "xField": "name", 
    "yField": "data1", 
    "yAxis": 2, 
    "type": "line" 
}], 

이것은 지원 포럼에서 이미보고 한 Sencha 버그입니다. 어떤 이유로 그들은 객체 프로퍼티의 순서에 의존하기 때문에 프로퍼티를 객체에 배치하는 순서가 실제로 중요합니다.