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
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.
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
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(); }
my problem: alert("row: " + row + " column:" + column + " value: " + value + " row_label: " + row_label + " Column_Label: " + column_label + " layer_id: " + layer_id + " evt_Type: " + evt_type + " this_ref: " + this_ref.toString); and when the page load row , column are undefined. i remove juste this alert now it okay.
Thank u David
this worked okay for me when i tested it. i added a chart to a page, handled the Page_Load, ChartDataClicked, and ClientOnMouseClick events as follows:
protected void Page_Load(object sender, EventArgs e) { this.UltraChart1.Data.DataSource = Infragistics.UltraChart.Data.DemoTable.Table(); this.UltraChart1.Data.DataBind(); } protected void UltraChart1_ChartDataClicked(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs e) { Response.Write("Server Click"); }
function UltraChart1_ClientOnMouseClick(this_ref, row, column, value, row_label, column_label, evt_type, layer_id){ alert("client click");}
i saw both the alert message and the response.write when i clicked on a datapoint. i have attached the sample project. does this work for you?
Hi David,
There are no javascrip errors on the page when it first loads ....
The problem was that i use alert and the function which call when the User click on the Chart. Without alert function it works.
Thanks
do you see any javascript errors on the page when it first loads? in the status bar perhaps?
Hello David,
Yes i did it but it is still not working. Actually i try with ClientOnMouseClick on client side.