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"

        listOfProductSales.Add(sales)


        sales = New ProductSales()

        sales.Quantity = 2

        sales.Amount = 200

        sales.SaleRate = 10

        sales.DocDate = "13/01"

        sales.Product = "ABC"

        listOfProductSales.Add(sales)


        sales = New ProductSales()

        sales.Quantity = -1

        sales.Amount = -100

        sales.SaleRate = -10

        sales.DocDate = "13/01"

        sales.Product = "ABC"

        listOfProductSales.Add(sales)


        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.


Regards,

Raja.



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
below

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.

Chart

Description automatically generated


Regards,

Moneeshram


Attachment: SF_179989SAM_72ac8d09.zip

Loader.
Up arrow icon