Sorting a stacked bar chart by the sum of each stack

3 posts, 0 answers
  1. Jonathan
    Jonathan avatar
    15 posts
    Member since:
    Dec 2014

    Posted 16 Mar 2015 Link to this post

    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. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 18 Mar 2015 Link to this post

    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.

     
  3. DevCraft banner
  4. Jonathan
    Jonathan avatar
    15 posts
    Member since:
    Dec 2014

    Posted 18 Mar 2015 in reply to Martin Link to this post

    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
Back to Top