Using OtherSlice gives incorrect data
Posted: Mon Aug 02, 2010 11:25 am
Hi
I'm using Teechart V2 (build 2.0.2489.20951) in an aspx application in Visual Studio 2005.
I am creating a Chart as below ....
Dim objPie As New Steema.TeeChart.Styles.Pie
objPie.OtherSlice.Style = Steema.TeeChart.Styles.PieOtherStyles.BelowPercent
objPie.OtherSlice.Value = 15
objPie.OtherSlice.Text = "Other"
TChart.Chart.Series.Add(objPie)
TChart.Chart.Legend.Visible = False
TChart.Chart.Series(0).Marks.Visible = True
TChart.Chart.Series(0).Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelPercent
TChart.Chart.Series(0).Add(CDbl(32), "Slice1", System.Drawing.Color.Red)
TChart.Chart.Series(0).Add(CDbl(30), "Slice2", System.Drawing.Color.Blue)
TChart.Chart.Series(0).Add(CDbl(25), "Slice3", System.Drawing.Color.Green)
TChart.Chart.Series(0).Add(CDbl(5), "Slice4", System.Drawing.Color.Yellow)
TChart.Chart.Series(0).Add(CDbl(8), "Slice5", System.Drawing.Color.Cyan)
Now you will see that the data values I have provided here add up to 100, so that each slice should have a percentage of the whole pie which is equal to the data value, ie Sloice 1 will occupy 32% of the pie. This works fine when all the values are shown seperately - without using the "OtherSlice" feature.
However, when I use the OtherSlice feature as in the above code, with the OtherSlice.Value set to 15, Slice4 and Slice5 become combined as the "Other" Slice but my pie chart then shows the following values for the slices ...
Slice 1 = 36.78%
Slice2 = 34.48%
Slice3 = 28.74%
Other = 14.94%
This gives a total pie of 114.98% which is obviously wrong!
You will see that the three ungrouped Slices 1 to 3 actually add up to the 100% (rounding errors accepted)
What is going on here?
Regards
Mike
I'm using Teechart V2 (build 2.0.2489.20951) in an aspx application in Visual Studio 2005.
I am creating a Chart as below ....
Dim objPie As New Steema.TeeChart.Styles.Pie
objPie.OtherSlice.Style = Steema.TeeChart.Styles.PieOtherStyles.BelowPercent
objPie.OtherSlice.Value = 15
objPie.OtherSlice.Text = "Other"
TChart.Chart.Series.Add(objPie)
TChart.Chart.Legend.Visible = False
TChart.Chart.Series(0).Marks.Visible = True
TChart.Chart.Series(0).Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelPercent
TChart.Chart.Series(0).Add(CDbl(32), "Slice1", System.Drawing.Color.Red)
TChart.Chart.Series(0).Add(CDbl(30), "Slice2", System.Drawing.Color.Blue)
TChart.Chart.Series(0).Add(CDbl(25), "Slice3", System.Drawing.Color.Green)
TChart.Chart.Series(0).Add(CDbl(5), "Slice4", System.Drawing.Color.Yellow)
TChart.Chart.Series(0).Add(CDbl(8), "Slice5", System.Drawing.Color.Cyan)
Now you will see that the data values I have provided here add up to 100, so that each slice should have a percentage of the whole pie which is equal to the data value, ie Sloice 1 will occupy 32% of the pie. This works fine when all the values are shown seperately - without using the "OtherSlice" feature.
However, when I use the OtherSlice feature as in the above code, with the OtherSlice.Value set to 15, Slice4 and Slice5 become combined as the "Other" Slice but my pie chart then shows the following values for the slices ...
Slice 1 = 36.78%
Slice2 = 34.48%
Slice3 = 28.74%
Other = 14.94%
This gives a total pie of 114.98% which is obviously wrong!
You will see that the three ungrouped Slices 1 to 3 actually add up to the 100% (rounding errors accepted)
What is going on here?
Regards
Mike