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

Sorting a stacked bar chart by the sum of each stack

2 Answers 58 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 16 Mar 2015, 02:55 PM
Hi there,

I don't know if what I want is supported out of the box somehow but I haven't been able to figure it out in any case. I have some horizontal stacked bars, as shown in the attachment, and I want to sort them by the sum of the stack, so that the longest stack is rendered at the top of the chart, the second longest after that and so on. I know that the stack sum is available through the format expression "#STSUM" but I haven't been able to make use of that for sorting purposes. Maybe I was barking up the wrong tree with that idea.

I appreciate any and all help I can get.

Thanks,
Jonathan

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 18 Mar 2015, 02:13 PM
Hi Jonathan,

You can take a look at the Sorting help article and see if this will work for you. 

Note that the RadChart is our old charting component which has many known limitations and issues. This is why we created the new RadChartView which has better implementation and improved performance. The new controls are also very flexible and easier to set up. You can read about the differences between the charts in the RadChart vs. RadChartView help article. If you just start using a charting control in your application or its integration its not very complex I recommend you to use RadChartView instead. The chartview doesn't have a built-in functionality but you can sort your data before pass it in its series' ItemsSource. I attached a sample project demonstrating this approach. Please give it a try and let me know if it helps.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jonathan
Top achievements
Rank 1
answered on 18 Mar 2015, 02:41 PM
Hi Martin,

Thanks for your suggestions and for the sample project. I think sorting the data before passing it to the chart is my best option right now.

Thanks again,
Jonathan
Tags
Chart
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or