2014-02-09 81 views
3

有誰知道如何爲Kendo-UI數據viz條形圖創建點擊事件?Kendo UI圖表 - 單擊活動

我在kendo窗口內有這個圖,當你點擊其中一個酒吧時,我需要換出窗口的內容。

我似乎無法找到附上點擊右邊元素.....

劍道代碼......

<script> // Kendo Chart 
      function createChart() { 
       $("#chart").kendoChart({ 
        title: { 
         text: "Memberships by dddd- dddd" 
        }, 
        legend: { 
         visible: true 
        }, 
        seriesDefaults: { 
         type: "bar" 
        }, 
        series: [{ 
         name: "dddd", 
         data: [123, 42, 76, 344], 
         color: '#0A9ECC' 
        }, { 
         name: "dddd", 
         data: [76, 970, 23, 14], 
         color: '#CE1D1D' 
        }, 
        { 
         name: "ddddd", 
         data: [144, 44, 264, 647], 
         color: '#d2b723' 
        }], 
        valueAxis: { 
         max: 1000, 
         line: { 
          visible: false 
         }, 
         minorGridLines: { 
          visible: true 
         } 
        }, 
        categoryAxis: { 
         categories: ["Membership 1", "Membership 2", "Membership 3", "Membership 4"], 
         majorGridLines: { 
          visible: false 
         } 
        }, 
        tooltip: { 
         visible: true, 
         template: "#= series.name #: #= value #" 
        } 
       }); 
      } 
      $(document).ready(createChart); 
      $(document).bind("kendo:skinChange", createChart); 
     </script> 

回答

5

我認爲你正在尋找seriesClick事件。

$(".k-chart") 
    .data("kendoChart") 
    .bind("seriesClick", function (e) { console.log(e); }) 
+0

謝謝@CodingWithSpike! – Mark