This is a migrated thread and some comments may be shown as answers.

Drilldown Pie Chart

1 Answer 106 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Tim Rankel
Top achievements
Rank 2
Tim Rankel asked on 07 Jun 2010, 10:00 PM
Hi,

I'm having an issue with the RadChart.Series collection when performing a drilldown operation utilizing the Click event.

I'm able to perform the operation without any issues if I have drilldown target chart on the webpage (just discretely placed) and just copy its series to the primary chart, however, this seems like cheating.

My goal is to have pie charts that can drill into more detail per click. They are currently using different SQLDataSources.

My problem is that when I drilldown to the secondary chart, only the first datarow appears to be populating the chart. The datasource is working correctly as I have another chart setup ( as mentioned above ) to check the results. I believe there is an attribute that I am missing or not overriding correctly and would appreciate any assistance in locating it.

Attached: (1) Before, (2) After, (3) Target goal. (Had to black out the labels due to privacy)

Here's the code behind:

protected void RadChart2_Click(object sender, Telerik.Charting.ChartClickEventArgs args)  
        {  
                      
            if (args.SeriesItem != null)  
                if (args.SeriesItem.Parent.Name == "a1")  
                {  
                     
                        //Switch chart to b1  
 
                        RadChart2.Series[0].Clear();  
                        RadChart2.PlotArea.XAxis.DataLabelsColumn = "bX1";  
 
                        RadChart2.Series[0].DataLabelsColumn = "bX1";  
                        RadChart2.Series[0].DataXColumn = "bX1";  
                        RadChart2.Series[0].DataYColumn = "bY1";  
                        RadChart2.PlotArea.XAxis.DataLabelsColumn = "bX1";  
                        RadChart2.Series[0].Name = "b1";  
 
                        RadChart2.ChartTitle.TextBlock.Text = args.SeriesItem.Name  
                            + " b1";  
                        RadChart2.DataSourceID = "datasourceB1";  
 
                }  
                else if (args.SeriesItem.Parent.Name == "b1")  
                {  
                 //Switch chart to a1  
                      
                    RadChart2.Series[0].Clear();  
                    RadChart2.PlotArea.XAxis.DataLabelsColumn = "aX1";  
                      
                    RadChart2.Series[0].DataLabelsColumn = "aX1";  
                    RadChart2.Series[0].DataXColumn = "aX1";  
                    RadChart2.Series[0].DataYColumn = "aY1";  
                    RadChart2.Series[0].DefaultLabelValue = "#Y";  
                    RadChart2.Series[0].Name = "a1";  
 
                      
                    RadChart2.ChartTitle.TextBlock.Text = "a1";  
                    RadChart2.DataSourceID = "datasourceA1";  
                 
                }  
               
          
 
        } 

1 Answer, 1 is accepted

Sort by
0
Tim Rankel
Top achievements
Rank 2
answered on 07 Jun 2010, 10:57 PM
Disregard - figured it out. Apparently posting an issue on the forum is something I should do after spending twenty minutes looking into an issue, because until then, I'm smacking my head against the wall and then I magically find the solution.

Issue was that the XAxis items were databound and an error was occuring (yet not being thrown) because the SqlDatasource difference in column names. Strange beans. So I fixed it by doing what I was intending to do after I resolved this issue -- handle the different SqlDataSource tooltips.
Tags
Chart (Obsolete)
Asked by
Tim Rankel
Top achievements
Rank 2
Answers by
Tim Rankel
Top achievements
Rank 2
Share this question
or