hello,
i have a fonction to render my chart, i try to add drilldown possibilitie but i didn't work:
public void RenderPieChart(Information model, UltraChart ToRenderPieChart) { //var wert = model.werte; //var Von = model.DatumVon; var preset = new ControlChartTyp(PieChart); ToRenderPieChart.ChartType = ChartType.PieChart; ToRenderPieChart.Data.ZeroAligned = true; ToRenderPieChart.LoadPreset(preset.GetFilePath(), true); //Setting Chart Drilldown ToRenderPieChart.Drill.Enabled = true; DrillElement pieChartDD = new DrillElement(); ToRenderPieChart.Drill.DrillElements = new DrillElement[] {pieChartDD }; ToRenderPieChart.Drill.DrillElements[0].DrillDown = new ChartDrillDown(ToRenderPieChart); NumericSeries series = new NumericSeries() { Label = "Pie Chart" }; series.Points.Add(new NumericDataPoint(2, "Anzeigenblatt", false)); series.Points.Add(new NumericDataPoint(4, "Fachzeitschrift", false)); series.Points.Add(new NumericDataPoint(6, "Kundenzeitschrift", false)); series.Points.Add(new NumericDataPoint(1, "Nachrichtenagentur", false)); series.Points.Add(new NumericDataPoint(4, "Internet-Publikation", false)); series.Points.Add(new NumericDataPoint(3, "Publikumszeitschrift", false)); series.Points.Add(new NumericDataPoint(3, "Supplement", false)); series.Points.Add(new NumericDataPoint(70, "Tageszeitung", false)); series.Points.Add(new NumericDataPoint(2, "TV-Sendung", false)); series.Points.Add(new NumericDataPoint(5, "Wochenzeitung", false)); ToRenderPieChart.Series.Add(series); ToRenderPieChart.PieChart.OthersCategoryPercent = 0; ToRenderPieChart.PieChart.Labels.Font = new System.Drawing.Font("arial", 5); ToRenderPieChart.Legend.SpanPercentage = 30; ToRenderPieChart.PieChart.ColumnIndex = -1; }and i have a class ChartDrillDown implement like in http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Chart_Drilldown.html and the event in this class. The Event ist not raise
Thank you very much for your help
have you hooked up the event handler using code like this?
this.UltraChart1.ChartDataClicked += new ChartDataClickedEventHandler(UltraChart1_ChartDataClicked);
Hello David,
Thanks for your answer but the Problem is the Event ist not Raise, that is to say the function UltraChart1_ChartDataClicked ist not call.
Thanks
just use the ChartDataClicked event to take appropriate action when a click occurs.
protected void UltraChart1_ChartDataClicked(object sender, ChartDataEventArgs e) { switch (e.DataRow) { case 0: this.UltraChart1.Data.DataSource = new double[] { 1, 2, 3 }; break; case 1: this.UltraChart1.Data.DataSource = new double[] { 4, 5, 6 }; break; case 2: this.UltraChart1.Data.DataSource = new double[] { 7, 8, 9 }; break; } this.UltraChart1.Data.DataBind(); }
Thanks David for your answer but i dont understand what you mean. May be any example or sample to illustrate it.
Thank you very much
the documentation you're referring to is from Windows Forms, and it won't work in ASP.NET. I recommend simplifying the problem by removing the code related to DrillElements, and just changing the chart's datasource in the ChartDataClicked event. you can implement DrillDown just as effectively this way.