Hi!
I bind my stack chart to a datatable with two columns. The first column is a string type and the second is a double type.
for ex
City, Sales
LA, 100
CA, 200
I recently switched from a 2d stack bar chart to a 3d one. Everything was working fine in the 2d chart. The legend had entries for the city column. WHne i changed the type to 3d stack bar.. without changing anything. the legend only shows the entry sales. where as the different city bars have different colors.
Why is this happening. Is there someway to tell the chart which column to use for the legend?
Ahmad
i saw this was submitted as a bug with the same source code in the sample ... the problem is fixed now, and will be part of an upcoming hotfix. if you need a temporary workaround, try setting ColorModel.ModelStyle to something other than CustomSkin.
toggling it doesnt work. basically then it applies the same color to all the bars in the chart. for both 3d and 2d.
try toggling the value of the ColorModel.Skin.ApplyRowWise property.
This is the code i use to generate the chart. Also iam using 2008 vol1.
In the case of a 2d stack chart the legend shows Cat A, Cat B....
In the case of a 3d stack chart, the legend only shows "Count".
Is there any way to get the chart to generate the same legend in the case of a 3d stack chart.
DataTable table = new DataTable(); table.Columns.Add(new DataColumn("Name", typeof(String))); table.Columns.Add(new DataColumn("Count", typeof(int))); table.Rows.Add(new object[ { "Cat A", 10 }); table.Rows.Add(new object[ { "Cat B", 20 }); table.Rows.Add(new object[ { "Cat C", 30 }); table.Rows.Add(new object[ { "Cat D", 40 }); table.Rows.Add(new object[ { "Cat E", 10 }); table.Rows.Add(new object[ { "Cat F", 30 }); table.Rows.Add(new object[ { "Cat G", 20 }); UltraChart1.ColorModel.Skin.PEs.Add(new PaintElement(Color.FromArgb(89, 139, 235))); UltraChart1.ColorModel.Skin.PEs.Add(new PaintElement(Color.FromArgb(255, 255, 85))); UltraChart1.ColorModel.Skin.PEs.Add(new PaintElement(Color.FromArgb(162, 18, 6))); UltraChart1.ColorModel.Skin.PEs.Add(new PaintElement(Color.FromArgb(146, 208, 80))); UltraChart1.ColorModel.Skin.PEs.Add(new PaintElement(Color.FromArgb(193, 128, 14))); UltraChart1.ColorModel.Skin.PEs.Add(new PaintElement(Color.FromArgb(255, 209, 0))); UltraChart1.ColorModel.Skin.PEs.Add(new PaintElement(Color.FromArgb(222, 0, 0))); UltraChart1.ColorModel.Skin.ApplyRowWise = true; if (cType == 0) UltraChart1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.StackBarChart; else UltraChart1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.Stack3DBarChart; UltraChart1.Legend.Visible = true; UltraChart1.Legend.Location = Infragistics.UltraChart.Shared.Styles.LegendLocation.Left; UltraChart1.DataSource = table; UltraChart1.DataBind(); UltraChart1.ColorModel.Skin.ApplyRowWise = true;
That's strange. I'm not able to see any such difference; the two chart types behave exactly the same. What version of net advantage are you using, and what build? Also, it might help if you could post a code snippet.
Stack chart legend displays the column labels or the row labels (when SwapRowsAndColumn = true). This usually works automatically, but you could try using chart.Data.SetColumnLabels or chart.Data.SetRowLabels to assign column/row labels.
Thanks.