How to get the value of single pie slice using code


Author
Message
Alan Hubbard
Alan Hubbard
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)
Group: Forum Members
Posts: 5, Visits: 28
Hi
I have a requirement to show the top 10 pie slices and group all the rest together in one large slice. I need to add all the values for the large slice together, but I'm having difficulty accessing the values. Any tips/pointers are welcome. Thanks.
Here's my code:

double dLargeSliceValue = 0;
for (int i = pieSeries.GetDataPointCount(); i >= 0; i--)
  {
    dLargeSliceValue = dLargeSliceValue + pieSeries.Values[i].Value;
    if (i>9)
      { //group
        //add to value
        dLargeSliceValue = dLargeSliceValue + (double)pieSeries.Values[i]; /* this does not work */
        //remove initial slice
        pieSeries.RemoveDataPointAt(i);
      }
      else
      { //assign color
        pieSeries.FillStyles[i] = new NColorFillStyle(colorList[i]);
      }
  }
  // add a large slice
   NDataPoint dp = new NDataPoint(dLargeSliceValue, groupLabel);
   dp[DataPointValue.PieDetachment] = 1;
   pieSeries.AddDataPoint(dp);
Reply
Alan Hubbard
Alan Hubbard
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)
Group: Forum Members
Posts: 5, Visits: 28
Great, that worked, thanks!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search