Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
Cannot stop others section appearing in pie chart
posted

Hi i have read earlier posts that say to set the OthersCategoryPercent = 0 to stop the others section from appearing on a pie chart. I have added this into my code and it does not seem to have an effect. I am using a composite chart if this makes a difference.

I have made a sub which populates the values and creates the chart on the form

when i use the data, the chart is fine with no to others section

PickStatusOrders_Pie(10, 50, 37, 29, 8)

i do not get the others section

when i use the following data the others section appears

PickStatusOrders_Pie(56, 88, 42, 44, 6)

I added the line   

Me.UltPickStatusPieChart.PieChart.OthersCategoryPercent = 0

in the hope this would make sure all values where always shown but it does not seem to have an effect.

Is there something i am missing?

Thanks

Ian

My code is below

Imports Infragistics.Win.UltraWinGrid
Imports Infragistics.UltraGauge.Resources
Imports Infragistics.UltraChart.Shared.Styles
Imports Infragistics.UltraChart.Resources.Appearance
Imports Infragistics.UltraChart.Core.Layers

  Private Sub PickStatusOrders_Pie(ByVal NotReleasedValue As Integer, _
                                     ByVal ReleasedValue As Integer, _
                                     ByVal PickingValue As Integer, _
                                     ByVal DespatchedValue As Integer, _
                                     ByVal CancelledValue As Integer)
        Try
            Me.UltPickStatusPieChart.CompositeChart.ChartAreas.Clear()
            Me.UltPickStatusPieChart.CompositeChart.ChartLayers.Clear()
            Me.UltPickStatusPieChart.CompositeChart.Legends.Clear()
            Me.UltPickStatusPieChart.CompositeChart.Series.Clear()
        Catch
        End Try

        'stop lowest data values being grouped in 'others' Category
        Me.UltPickStatusPieChart.PieChart.OthersCategoryPercent = 0

        'set chart type
        Me.UltPickStatusPieChart.ChartType = ChartType.Composite

        'add new area
        Dim myChartArea As New ChartArea()
        Me.UltPickStatusPieChart.CompositeChart.ChartAreas.Add(myChartArea)


        'get data for chart
        Dim mySeries As New NumericSeries()
        mySeries.Label = "Pick Status"
        mySeries.Points.Add(New NumericDataPoint(NotReleasedValue, "NotReleased", False))
        mySeries.Points.Add(New NumericDataPoint(ReleasedValue, "Released", False))
        mySeries.Points.Add(New NumericDataPoint(PickingValue, "Picking", False))
        mySeries.Points.Add(New NumericDataPoint(DespatchedValue, "Despatched", False))
        mySeries.Points.Add(New NumericDataPoint(CancelledValue, "Cancelled", False))

        'add series
        Me.UltPickStatusPieChart.CompositeChart.Series.Add(mySeries)


        'add appearances
        Dim myColumnLayer As New ChartLayerAppearance()
        myColumnLayer.ChartType = ChartType.PieChart
        myColumnLayer.ChartArea = myChartArea
        myColumnLayer.Series.Add(mySeries)
        Me.UltPickStatusPieChart.CompositeChart.ChartLayers.Add(myColumnLayer)


        ' add legend
        Dim myLegend As New CompositeLegend()
        myLegend.ChartLayers.Add(myColumnLayer)
        myLegend.Bounds = New Rectangle(0, 75, 20, 25)
        myLegend.BoundsMeasureType = MeasureType.Percentage
        myLegend.PE.ElementType = PaintElementType.Gradient
        myLegend.PE.FillGradientStyle = GradientStyle.ForwardDiagonal
        myLegend.PE.Fill = Color.CornflowerBlue
        myLegend.PE.FillStopColor = Color.Transparent
        myLegend.Border.CornerRadius = 10
        myLegend.Border.Thickness = 0
        Me.UltPickStatusPieChart.CompositeChart.Legends.Add(myLegend)

    End Sub