Hi,
I have generated a 3D pie chart and have been using the following line of code to set the labels on the sections, where myChart is an UltraChart:
myChart.PieChart3D.Labels.FormatString = "<ITEM_LABEL>: <DATA_VALUE:#> (<PERCENT_VALUE:#>%)"
This works fine until I have a section which represents all the NULL values i.e. my data is grouped by regions and some of the contacts will have no associated region. When this is the case my label will look something like this:
<ITEM_LABEL>: 1000 (5%)
So is there anyway to set a value for a blank label? Also this does not happen if I use a normal 2D pie chart.
Thanks,
Andy
i was not able to reproduce this problem using the release version of WinChart v9.1. What is the complete (4-part) version number of the chart dll you are using? have you tested this using the latest hotfix?
I've tried this now with 9.1.20091.2023 and i'm still getting the same problem.
{ UltraChart myChart = new UltraChart(); myChart.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.PieChart3D; myChart.PieChart3D.Labels.FormatString = "<ITEM_LABEL>: <DATA_VALUE:#> (<PERCENT_VALUE:#>%)"; myChart.PieChart.OthersCategoryPercent = 0; DataTable dt = new DataTable(); dt.Columns.Add("Count", System.Type.GetType("System.Int16")); dt.Columns.Add("Region"); DataRow myRow = default(DataRow); myRow = dt.NewRow; myRow(0) = "100"; myRow(1) = "North"; dt.Rows.Add(myRow); myRow = dt.NewRow; myRow(0) = "200"; dt.Rows.Add(myRow); myChart.DataSource = dt; myChart.DataBind();}
I'm guessing the problem is something to do with the fact that my datasource will have NULL values not an empty string for the Region column. As I mentioned earlier if I use a normal 2D pie chart it handles this and just displays an empty string on my chart.
i was able to reproduce the problem with DBNull, so I logged it as a bug (#18358) and fixed it. it should be resolved in an upcoming hotfix. feel free to contact Infragistics Developer Support at any time to inquire about the status of this bug.
if you need a temporary workaround, you can implement IRenderLabel for the Pie Chart Labels and avoid outputting the <ITEM_LABEL> token.