Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
IG Pie Chart Slice Click Event
posted

Hello,

 

I just want to know how to bind the event slice Click to the JQUERY Pie Chart. 

 

Regards,

Chady

Parents
No Data
Reply
  • 1775
    Suggested Answer
    posted

    Hello, chadymezher

    The igPieChart control was CTP in the last 2011 Volume 2 release and unfortunately you cannot bind to the sliceClick event in this version. The new 2012 Volume 1 version is due to be released soon and you will be able to bind to this event like this: 

    Code Snippet
    1. $('#chart1').igPieChart({
    2.     dataSource: data,
    3.     width: '500px',
    4.     height: '500px',
    5.     valueMemberPath: 'Budget',
    6.     labelMemberPath: 'Label',
    7.     explodedSlices: '0 1',
    8.     radiusFactor: .8,
    9.     legend: { element: 'legend1', type: "item" },
    10.     //  Slice click event handler
    11.     sliceClick: function (evt, ui) {
    12.         //Use ui.chart to get reference to chart object.
    13.         ui.chart;
    14.  
    15.         //Use ui.slice to get reference to slice object.
    16.         ui.slice;
    17.  
    18.         //Use ui.slice.item to get reference to current pie chart item.
    19.         ui.slice.item;
    20.  
    21.         //Use ui.slice.isExploded to get is the slice exploded.
    22.         ui.slice.isExploded;
    23.  
    24.         //Use ui.slice.isSelected to get is the slice selected.
    25.         ui.slice.isSelected;
    26.     }
    27. });

    Please, reply if you need some more information.

    Regards, Lazar

Children