This is a migrated thread and some comments may be shown as answers.

Sorting with grouping

1 Answer 50 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Scott Waye
Top achievements
Rank 2
Veteran
Iron
Scott Waye asked on 19 Oct 2015, 09:05 PM

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

1 Answer, 1 is accepted

Sort by
0
Accepted
Petar Marchev
Telerik team
answered on 22 Oct 2015, 08:16 AM
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
Tags
Chart
Asked by
Scott Waye
Top achievements
Rank 2
Veteran
Iron
Answers by
Petar Marchev
Telerik team
Share this question
or