Pie Charts: take top 10 records; sort biggest to smallest

4 posts, 0 answers
  1. Jason
    Jason avatar
    12 posts
    Member since:
    Oct 2012

    Posted 24 Mar 2016 Link to this post

    I am struggling to make our pie charts look good and be useful -- here are the two issues (somewhat related):


    • The pie chart is connected to the same data source as a crosstab report, with the same groupings. Sometimes there are 20+ rows of data, and I want to display them all in the crosstab, but would like to only display the biggest 10 items on the pie chart, with the rest grouped under "Other." Is this possible?
    • I would like to sort the order that wedges appear in the pie chart by size. Sorting by Field.MyNumber doesn't work because I actually want to sort on Sum(Field.MyNumber), but I get an error from the designer telling me I can't order by aggregate.


    Are there solutions to these two items?


  2. Ivan Hristov
    Ivan Hristov avatar
    117 posts

    Posted 28 Mar 2016 Link to this post

    Hello Jason,

    We've answered your inquiry in the support thread you've opened.

    Ivan Hristov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Zach
    Zach avatar
    13 posts
    Member since:
    Jul 2014

    Posted 24 Mar Link to this post

    What was the resolution to this issue?  It'd be much more helpful to everyone else if the solution was posted publicly 
  4. Jason
    Jason avatar
    12 posts
    Member since:
    Oct 2012

    Posted 24 Mar in reply to Zach Link to this post

    Hi Zach - good point.


    For getting "Top N + Other" in the pie chart, there were two choices:

    1. There is no out-of-the-box functionality to enable the rest of the data rows to appear as "others" group in the chart. However, this grouping can be achieved using a group expression containing a conditional function that calculates the Top N lower bound data point.
    2. Another approach is to modify the data rows before passing them to the Graph item and add some of the rows to a new "others" group. This can be achieved using the ObjectDataSource Component.

    I can't remember if I tried either of these. The reports as I view them today doesn't use the Top N feature and they're ugly. Apparently I explained the investment and performance hit required to accomplish this with Telerik Reports and the customer decided what we had was good enough.

    For the sorting, the resolution was straight-forward: "You have to apply the sorting on the series group you're using in your PieChart. This will allow the series to be ordered by the evaluated result of the aggregate function you use in the sorting expression."






Back to Top