Pie Chart question

Thread is closed for posting
2 posts, 0 answers
  1. Quyen
    Quyen avatar
    9 posts
    Member since:
    Dec 2007

    Posted 21 Dec 2007 Link to this post

    Hi All :) ,

    is it possible know the region area when the user click on a pie chart ?

    For example:

    I have a pie chart that displays the number of schedules jobs that that runs on a daily basis;  let say 40 jobs failed and 50 succeed .. I want to know if it is possible
    to know if the users clicks on Failures region it will fires an event  to drill down a grid and show the details of these jobs?

    Thanks In Advance
  2. Dwight
    Dwight avatar
    475 posts

    Posted 27 Dec 2007 Link to this post

    Hi Quyen,

    Thank you for contacting us. The click event of the RadChart exposes the following information through the ChartClickEventArgs:
    • SeriesItem - the item that have been clicked.
    • Series - the series to which the item belongs.
    Here is a short example demonstrating the functionality would like to implement:

            public Form3()  
                //hook up the event handler  
                radChart1.Click += new Telerik.WinControls.UI.RadChart.ChartClickEventHandler(this.radChart1_Click);  
                //create series  
                radChart1.CreateSeries("Outcomes", Color.Black, Color.Black, ChartSeriesType.Pie);  
                //add items  
                ChartSeriesItem csi = new ChartSeriesItem();  
                csi.Name = "Successes";  
                csi.YValue = 55;  
                ChartSeriesItem csi1 = new ChartSeriesItem();  
                csi1.Name = "Failures";  
                csi1.YValue = 5;  
                //refresh the chart  
            private void radChart1_Click(object sender, ChartClickEventArgs args)  
                if (args.Element.ActiveRegion.Parent is ChartSeriesItem)  
                    MessageBox.Show((args.Element.ActiveRegion.Parent as ChartSeriesItem).Name + " pie sector clicked");  
                    if ((args.Element.ActiveRegion.Parent as ChartSeriesItem).Name.Equals("Failures"))  
                        MessageBox.Show("Place custom code to show failures here");  

    Please, let us know if that helps. If you have further questions, do not hesitate to ask.

    All the best,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top