Hello... I need some help. Some days ago I am trying to fix a problem with a bar chart. The description of the problem is this:The program I'm fixing have the capacity of show charts on 2D and 3D taking data from a data base, i can choose the chart type selecting the kind of chart on a combo box. When i change from 2D to 3D there is not problem. The chart looks normal and with all the data.
The normal chart on 2D:
http://imageshack.com/a/img853/8757/csvp.jpg
The chart on 3D:
http://imageshack.com/a/img9/4097/z3n4.jpg
But when i try to go back from 3D to 2D the chart breaks down completely. The bars shows up with the same color although i have my own Color Model implemented, very separated from each other although i set it on 0, the labels of the columns have the same value, and only one chart legend shows up.
The broken chart:
http://imageshack.com/a/img823/2003/5g0l.jpg
I have checked the chart methods many times. All the methods apparently are alright. I debugged the program from the SQL of the data base to the last line of C# code, step by step. But i can not find any logical reason why the chart is breaking. Something very special that happens is that when i am on the broken chart and i go again to the 3D bar chart, is alright on everything (color, size, form, position etc).
Could you please give to me any kind of advice? May be i made some kind of mistake on the code.
Hello,
I will be happy to assist you with this issue.
In an attempt to reproduce this behavior, I have created my own sample which utilizes a chart series to display similar data as shown in the screenshots you've provided. I have not been able to reproduce the behavior described using my sample. I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version 13.1.20131.2107 in NetAdvantage for ASP.NET 2013 Volume 1.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing. Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if you have any questions regarding this matter.
I have also tried with NetAdvantage for ASP.NET 2011 Volume 1 and was able to successfully switch between 2D and 3D several times without issues. I have attached my modified sample onto this post. Please run the sample and let me know if you can modify it to reproduce the issue you're encountering or have an isolated sample I can use to reproduce this behavior.
May I ask if you are doing something different than I am with my sample? If so, please provide me with more details or code you are using when switch between 2D and 3D. This will help me isolate the cause of this issue and move forward to providing you with a solution.
Hello, Mr. Jose. I downloaded and tried your example...It did not worked. It threw me this error: http://imageshack.com/a/img707/3449/nmn0.jpgAccording with my system the version of Infragistics i got is 11.1.0: http://imageshack.com/a/img94/3830/p8td.jpgTo be more specific is the version 11.1.20111.1006: http://imageshack.com/a/img41/4466/hb8m.jpgYou are using the version 11.1.20111.2238. On addition, my machine is an x64, so the hint path and the version declaration are wrong for it. I did some changes, at last i could run the example.Wow... I did not know there was an other way to change from 2D to 3D and vice-versa.
Here is the entire code of the method that draws the charts on my system, please check it, may be you could find an error i'm not seeing: private bool aplicarPropiedadesGrafico(UltraChart pChart, Hashtable pObjDatos, bool pBln3D = false) { pChart.Data.DataSource = pObjDatos[enumGraficoCampos.DataTable.ToString()]; //Here i take the DataTable to make the data bind; if (pChart.Data.DataSource == null) return false; //If the source is empty the method ends. pChart.Data.DataBind(); #region to set the color model pChart.ColorModel.ModelStyle = Infragistics.UltraChart.Shared.Styles.ColorModels.CustomLinear; Color[] C = { Color.Red, Color.Blue, Color.Green, Color.Yellow, Color.Purple, Color.Orange, Color.Silver, Color.Navy, Color.Khaki, Color.Coral, Color.MistyRose, Color.DarkKhaki, Color.DarkSeaGreen, Color.LightSteelBlue, Color.Violet, Color.HotPink };//Vector of colors, the orther of the vector defines the order of the color on the charts. pChart.ColorModel.CustomPalette = C; //Set the color palette to the chart. pChart.ColorModel.AlphaLevel = 255; //Set the transparency of the chart. (Only 3D Areas and 3D BarCharts) //It set the 3D charts Background color, not to DoughnutChart or PieChart Color color = Color.White; pChart.Axis.BackColor = color; //2D Charts PaintElement paintElement = new PaintElement(color); pChart.Axis.PE = paintElement; #endregion #region to set the monitor 3d charts int tg = (int)pObjDatos[enumGraficoCampos.TipoGrafico.ToString()]; //This variable is for know if the chart comes for a specific monitor where the graphics appear all on 3D. if (tg == 1 || tg == 3 || tg == 5 || tg == 7 || tg == 10 || tg == 12 || tg == 14){ if (tg == 1 || tg == 3 || tg == 7 || tg == 10 || tg == 12) tg = tg + 1; else if (tg == 5) tg = 16; else tg = 17; } #endregion #region is to change the "round" charts. //On this region must change the "PieChart3D.OthersCategoryText" depending of the language; if (pChart.ChartType == ChartType.PieChart3D || pChart.ChartType == ChartType.DoughnutChart){ if (this.gIntIdioma == 1 && this.gIntIdiomaInterf == 1){ if (pChart.ChartType.ToString().Equals("PieChart")){ pChart.PieChart3D.OthersCategoryPercent = 5; pChart.PieChart3D.OthersCategoryText = "Valores Menores a 10%"; } else{ pChart.DoughnutChart3D.OthersCategoryPercent = 5; pChart.DoughnutChart3D.OthersCategoryText = "Valores Menores a 10%"; } } else{ if (pChart.ChartType.ToString().Equals("PieChart3D")){ pChart.PieChart3D.OthersCategoryPercent = 5; pChart.PieChart3D.OthersCategoryText = "Minor Values at 10%"; } else{ pChart.DoughnutChart3D.OthersCategoryPercent = 5; pChart.DoughnutChart3D.OthersCategoryText = "Minor Values at 10%"; } } } #endregion if (pBln3D) pChart.ChartType = mapChartType(tg);//Depending of the results of the monitor 3D charts the system sets here the ChartType else pChart.ChartType = mapChartType((int)pObjDatos[enumGraficoCampos.TipoGrafico.ToString()]);//If the chart is not for a monitor then we ask for the type that comes by parameters if (pChart.ChartType.ToString().IndexOf("3D") > 0)//If the chart is an 3D chart { pChart.Transform3D.Scale = 60;//Change the chart to makeit fit on the window. #region Tilting and minimum percentages category /// Region Modified Here we define the minimum range to group values in pie and donut chart /// It also modifies the degree of inclination with the graphic shown when in 3D /// PChart.PieChart3D.OthersCategoryPercent = 5, / / minimum value smaller values of the pie and donut /// Also we assign the degree of rotation that will give the graph on the axes X, Y, Z.
//Private variables of the class (X, Y and Z) pChart.Transform3D.XRotation = X; pChart.Transform3D.YRotation = Y; pChart.Transform3D.ZRotation = Z; if (pChart.ChartType == ChartType.PieChart3D || pChart.ChartType == ChartType.DoughnutChart3D){ pChart.Transform3D.XRotation = X * 2; //On this region must change the "PieChart3D.OthersCategoryText" depending of the language; if (this.gIntIdioma == 1 && this.gIntIdiomaInterf == 1){ if (pChart.ChartType.ToString().Equals("PieChart3D")){ pChart.PieChart3D.OthersCategoryPercent = 5; pChart.PieChart3D.OthersCategoryText = "Valores Menores a 10%"; } else{ pChart.DoughnutChart3D.OthersCategoryPercent = 5; pChart.DoughnutChart3D.OthersCategoryText = "Valores Menores a 10%"; } } else{ if (pChart.ChartType.ToString().Equals("PieChart3D")){ pChart.PieChart3D.OthersCategoryPercent = 5; pChart.PieChart3D.OthersCategoryText = "Minor Values at 10%"; } else{ pChart.DoughnutChart3D.OthersCategoryPercent = 5; pChart.DoughnutChart3D.OthersCategoryText = "Minor Values at 10%"; } } } if (pChart.ChartType == ChartType.BarChart3D || pChart.ChartType == ChartType.AreaChart3D || pChart.ChartType == ChartType.LineChart3D){ if (pChart.ChartType == ChartType.AreaChart3D || pChart.ChartType == ChartType.LineChart3D) pChart.Transform3D.XRotation = X * (-2); pChart.Data.SwapRowsAndColumns = true; } if (pChart.ChartType == ChartType.BarChart){ pChart.Data.SwapRowsAndColumns = false; } /// #endregion } #region other parameters #region To show the labels of axis. //There is not need to show the labes on the BarChart3D if (pChart.ChartType.ToString().Equals("BarChart3D")) pChart.Axis.Y.Labels.Visible = false; else pChart.Axis.Y.Labels.Visible = true; //The other labes must be always visible. pChart.Axis.X.Labels.Visible = true; pChart.Axis.Z.Labels.Visible = true; pChart.Legend.Visible = true; #endregion #region Margins pChart.Legend.Margins.Bottom = (int)pObjDatos[enumGraficoCampos.MarginBottom.ToString()]; pChart.Legend.Margins.Top = (int)pObjDatos[enumGraficoCampos.MarginTop.ToString()]; pChart.Legend.Margins.Left = (int)pObjDatos[enumGraficoCampos.MarginLeft.ToString()]; pChart.Legend.Margins.Right = (int)pObjDatos[enumGraficoCampos.MarginRight.ToString()]; if ((int)pObjDatos[enumGraficoCampos.BorderSize.ToString()] < 100) pChart.Legend.BorderThickness = (int)pObjDatos[enumGraficoCampos.BorderSize.ToString()]; else pChart.Legend.BorderThickness = 100;//Si el tamaño del borde supera el permitido, se le iguala hasta el limite #endregion #region Texts pChart.TitleTop.Text = (string)pObjDatos[enumGraficoCampos.DGrafico.ToString()]; pChart.TitleTop.HorizontalAlign = StringAlignment.Center; pChart.TitleTop.Visible = (pChart.TitleTop.Text.Length > 0); pChart.TitleBottom.Text = (string)pObjDatos[enumGraficoCampos.TitleBottom.ToString()]; pChart.TitleBottom.Visible = (pChart.TitleBottom.Text.Length > 0); pChart.TitleBottom.HorizontalAlign = StringAlignment.Center; pChart.TitleLeft.Text = (string)pObjDatos[enumGraficoCampos.TitleLeft.ToString()]; pChart.TitleLeft.Visible = (pChart.TitleLeft.Text.Length > 0); pChart.TitleRight.Text = (string)pObjDatos[enumGraficoCampos.TitleRight.ToString()]; pChart.TitleRight.Visible = (pChart.TitleRight.Text.Length > 0); #endregion #region Labels //Columns if (((string)pObjDatos[enumGraficoCampos.ColumnLabels.ToString()].ToString()).Length > 0) pChart.Data.SetColumnLabels(((string)pObjDatos[enumGraficoCampos.ColumnLabels.ToString()]).Split(",".ToCharArray())); //Rows if (((string)pObjDatos[enumGraficoCampos.RowLabels.ToString()]).Length > 0) pChart.Data.SetRowLabels(((string)pObjDatos[enumGraficoCampos.RowLabels.ToString()]).Split(",".ToCharArray())); #endregion //Axis Extent pChart.Axis.X.Extent = (int)pObjDatos[enumGraficoCampos.XExtent.ToString()]; pChart.Axis.Y.Extent = (int)pObjDatos[enumGraficoCampos.YExtent.ToString()]; pChart.Data.ZeroAligned = (bool)pObjDatos[enumGraficoCampos.ZeroAligned.ToString()]; #region Labels Formats //Formats for Columns if (pObjDatos[enumGraficoCampos.XItemFormatStr.ToString()].ToString().Length > 0) { pChart.Axis.X.Labels.ItemFormat = AxisItemLabelFormat.Custom; pChart.Axis.X.Labels.ItemFormatString = pObjDatos[enumGraficoCampos.XItemFormatStr.ToString()].ToString(); pChart.Tooltips.Format = TooltipStyle.Custom; pChart.Tooltips.FormatString = pObjDatos[enumGraficoCampos.XItemFormatStr.ToString()].ToString(); } //Labels for Rows if (pObjDatos[enumGraficoCampos.YItemFormatStr.ToString()].ToString().Length > 0) { //SI es asi se modifican las fuentes pChart.Axis.Y.Labels.ItemFormat = AxisItemLabelFormat.Custom; pChart.Axis.Y.Labels.ItemFormatString = pObjDatos[enumGraficoCampos.YItemFormatStr.ToString()].ToString(); } //Translation of the labels. if (pChart.TitleBottom.Text.IndexOf("$1$") >= 0) { pChart.TitleBottom.Text = gObjDatos.traduccionEspecial( double.Parse(pObjDatos[enumGraficoCampos.CNodo.ToString()].ToString()), double.Parse(pObjDatos[enumGraficoCampos.CGrafico.ToString()].ToString()), "TitleBottom" ); } #endregion #region To set the Data.SwapRowsAndColums //Verification of the chart to show if (pChart.ChartType == ChartType.LineChart || pChart.ChartType == ChartType.LineChart3D || pChart.ChartType == ChartType.AreaChart || pChart.ChartType == ChartType.AreaChart3D) { pChart.Data.SwapRowsAndColumns = true; pChart.Data.ZeroAligned = true; pChart.Axis.X.Labels.ItemFormat = AxisItemLabelFormat.ItemLabel; pChart.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL>"; } #endregion #endregion return true; // end of the method. }The steps that the system uses to change the chart type are these:onChange of the comboBox:-> get the new type of chart to show.-> set the parameters for the chart-> create an object of the class that draws the graphics.-> pass the parameters to the method-> shows the chart..Thanks for your attention.
I believe this behavior is due to using the SwapRowsAndColumns property. I am investigating this further, however I would like to ask if you can remove the setting of SwapRowsAndColumns property in your code to see if this behavior is still reproducible.
I am looking forward to hearing from you.
I am getting 'undefined' as tooltip when i scroll over my column chart can you please help .. how to remove undefined and show the y-axis values instead.
Thanks