Sorting with grouping

2 posts, 1 answers
  1. Scott Waye
    Scott Waye avatar
    111 posts
    Member since:
    Nov 2009

    Posted 19 Oct 2015 Link to this post

    Hi,

    I have a top N style bar chart with 2 series, inputs and ouputs.  X axis is company names, and y axis is an aggregate of the amount.  This is much like the documentation at http://docs.telerik.com/devtools/wpf/controls/radchart/features/grouping/and-aggregation and the second last picture where you show the sum of all apples and bananas per year and region.   For ​2008 I have inputs, and for 2009 I have outputs, for regions I have companies and for quantity I have amount. I have the correct data displayed, but I want to sort the data so that, in your example, the region with the highest 2008 figure comes first, so Europe(331) is on the top, then North America (322), then Asia (316).  In other words the sorting is defined by one of the series. How can I do that? 

     

    Thanks

  2. Answer
    Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 22 Oct 2015 Link to this post

    Hello Scott,

    I think that the easiest way to go here is to simply order the data prior to feeding the chart. Once you have the data sorted so that Europe appears before North America, and Asia appears last, the grouping should automatically make Europe as the first group and North America as the second. Alternatively, I suppose that you can use custom sort descriptors which require a bit more work.

    On a side note I would like to mention that you are using the old RadChart, which has many limitations and it is in maintenance mode now. We suggest you use the new RadChartView for new development. The chartview is actually a set of controls, such as the RadCartesianChart, RadPieChart, RadPolarChart, ChartDataSource. The chartview does not have any built-in grouping or sorting capabilities, and if you need grouping or sorting, you need to do it before you set the ItemsSource. However, it really results in the same amount of work as setting up the group/sort descriptors in the old chart.

    Here are some links:
    qsf examples
    sdk samples
    online documentation

    Regards,
    Petar Marchev
    Telerik
    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. DevCraft banner
Back to Top