2013-12-23 2 views
0

하나의 도넛 형 차트를 만들었지 만, 이상한 이유로 인해 청취자를 처리 할 수 ​​없습니다. 시리즈 내외부에서 리스너를 추가하려고 시도했지만 작동하지 못했습니다.랠리 파이 차트 수신기가 작동하지 않습니다.

사람이 제가 아래 여기에 누락 될 수 있습니다 알려 주시기 바랍니다 수 는 코드 snipet

VAR 차트 = Ext.create ('Rally.ui.chart.Chart', {

    chartConfig: { 
         chart: { 
          type: 'pie', 
          /*events: { 
      click: function(event) { 
      console.dir("Clicked"); 
      } 
      }*/ /*THis works but it generates events only on click of the text on the pie charts*/ 
         }, 
         title: { 
          text: 'Defects per Release Status ' 
         }, 
         yAxis: { 
          title: { 
           text: 'Total Defects per project' 
          } 
         }, 
         plotOptions: { 
          pie: { 
           shadow: false, 
           center: ['50%', '50%'] 
          } 
         }, 
         tooltip: { 
          valueSuffix: '%' 
         }, 
         series: [{ 
          name: 'Teams', 
          data: teamData, 
          size: '60%', 
          dataLabels: { 
           formatter: function() { 
            return this.y > 5 ? this.point.name : null; 
           }, 
           color: 'white', 
           distance: -40 
          } 
         }, { 
          name: 'Defects', 
          data: defectData, 
          size: '80%', 
          innerSize: '60%', 
          dataLabels: { 
           formatter: function() { 
            // display only if larger than 1 
            return this.y > 1 ? '<b>' + this.point.name + ':</b> ' + this.y + '%' : null; 
           } 
          } 
         }] 
        }, 

         listeners: { 
    click: {   
     element: 'el', //bind to the underlying el property on the panel 
     fn: function(){ console.log('click el'); } 
    }, 
    dblclick: { 
     element: 'body', //bind to the underlying body property on the panel 
     fn: function(){ console.log('dblclick body'); } 
    } 
} 

       }); 
다음과 같이 작동합니다으로 chartConfig.plotOptions에 클릭 이벤트를 추가
+1

당신은 jsfiddle에서 같은 것을 재현하려고 노력할 수 있습니까? 그것은 실제로 우리가 무엇이 잘못되었는지를 이해하는 데 도움이 될 것입니다. – Strikers

+0

확실히 시도 할 수는 있습니다. 그러나 어떻게 든 이것이 길과 관련 될 수 있다고 생각합니다. 집회이기 때문에 집회가 아니라 고 차트보다는 해석합니다. 맞춤 앱 – user3129202

+0

감사합니다. http://jsfiddle.net/xXwax/에서 몇 가지 진전을 이뤘습니다. 나는 더 발전 할 것이다. – user3129202

답변

0

은. 당신은 this repo에 평결 원형 차트로 랠리 TestCaseResults의 전체 예를 볼 수 있습니다.

plotOptions : { 
    pie: { 
     allowPointSelect: true, 
     cursor: 'pointer', 
     point: { 
     events: { 
      click: function(event) { 
      var options = this.options; 
      alert(options.name + ' clicked'); 
     } 
     } 
}, 
관련 문제