We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Pivot Chart showing wrong sum of quantity if quantity is -ve

sir i have a case in which  Quantity  fields can be +ve and -ve

some of values are -ve also. but pivot chart is adding -ve values also.

Pl check.

Data Sample

Public Class ProductSales

    Public Property Product As String

    Public Property DocDate As String

    Public Property Quantity As Double

    Public Property Amount As Double

    Public Property SaleRate As Double

    Public Shared Function GetSalesData(ByVal Dt As DataTable) As ProductSalesCollection

        Dim listOfProductSales As ProductSalesCollection = New ProductSalesCollection()

               Dim sales As ProductSales = New ProductSales()

        sales.Quantity = 1

        sales.Amount = 100

        sales.SaleRate = 10

        sales.DocDate = "13/01"

        sales.Product = "ABC"


        sales = New ProductSales()

        sales.Quantity = 2

        sales.Amount = 200

        sales.SaleRate = 10

        sales.DocDate = "13/01"

        sales.Product = "ABC"


        sales = New ProductSales()

        sales.Quantity = -1

        sales.Amount = -100

        sales.SaleRate = -10

        sales.DocDate = "13/01"

        sales.Product = "ABC"


        Return listOfProductSales

    End Function

    Public Class ProductSalesCollection

        Inherits List(Of ProductSales)

    End Class

End Class

2 Replies

RR Raja Ramalingam Syncfusion Team January 16, 2023 01:12 PM UTC

Hi Singh,

We will check with our development team and update the status on January 17, 2023. We appreciate your patience until then.



MD Moneeshram Dhanabal Syncfusion Team January 17, 2023 01:20 PM UTC

After analyzing your query, I would like to inform you that the given Pivot Calculation field values will be added properly only if you set the SummaryType property as the SummaryType.Sum enum that is shown in the code snippet

Me.PivotChart2.PivotCalculations.Add(New PivotComputationInfo With {.FieldName = "Quantity", .Format = "#,##0", .SummaryType = SummaryType.Sum})

This will add the data values of the given Pivot Calculation field and display its value in a single column. I have attached a demo image and sample for your reference.


Description automatically generated



Attachment: SF_179989SAM_72ac8d09.zip

Live Chat Icon For mobile
Up arrow icon