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
125
Others category comes back with "Undefined" for the number
posted

I have a doughnut chart on my page that I am filling with a data service. Once my data comes back, I have 9 items. With my current test data, 3 of them are small enough that the doughnut chart combines them into "Other". However, the number is displayed as "undefined". Here is the code for filling the chart:

var data = $.parseJSON(result);

                $("#doughnutChart").igDoughnutChart({
                    width: "100%",
                    height: "90%",
                    series:
                    [{
                        name: "Count",
                        labelMemberPath: "Status",
                        valueMemberPath: "Count",
                        dataSource: data,
                        labelsPosition: "bestFit",
                        formatLabel: function (context) {
                            return context.itemLabel + " (" + context.item.Count + ")";
                        }
                    }]
                });

Here is the test data I have:

[
   {
      Status:"Contributors",
      Count:100
   },
   {
      Status:"Pending",
      Count:282
   },
   {
      Status:"Expired",
      Count:3911
   },
   {
      Status:"Canceled",
      Count:674
   },
   {
      Status:"Active",
      Count:3711
   },
   {
      Status:"Prospects",
      Count:2033
   },
   {
      Status:"Error",
      Count:44
   },
   {
      Status:"Suspended",
      Count:2758
   },
   {
      Status:"Complimentary",
      Count:2
   }
]

Here is what it ends up looking like. Why is Others undefined?

doughnut chart