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

Sorting on Stacked Charts Changes

4 Answers 98 Views
Charts
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 15 Jul 2016, 05:43 PM

I created a stacked chart on "Component" with a sort on the "Code" column. With the stacked column the chart sorts correctly on Code with 11 coming before 54. But when I switch to the stacked/grouping mechanism on Component the sorting switches to 54 and then 11. It might be due to something else but all I can think of is the stacked variable took over the sorting. My example is located at http://dojo.telerik.com/@dhighfield/EfuVA/3. I am expecting the Code 11 to always come before 54 since I have sorting set to Code.

Thank you for your time and assistance as always.

4 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 19 Jul 2016, 06:44 AM
Hi David,

Setting group direction should help to achieve the expected outcome. For your convenience here is the modified dojo.

Regards,
Iliana Nikolova
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
David
Top achievements
Rank 1
answered on 20 Jul 2016, 01:57 AM

That is setting the group direction. The group direction is changing the x-axis sorting as well as within the group. 11 should always come before 54 since I have sorting set to "Code". Once I set the group as well it changes the sorting to "Component" which is fine within the column but not across all of the columns. The default of "asc" is fine within the column for a grouping but it should not sort amongst columns as well. If I change "Component": "AA" to "Component": "EE" in your example the x-axis columns change back to 54/11 instead of 11/54. The x-axis columns should be governed by the sort: {field: "Code",dir: "asc"} but seems to lose its use when in combination with the grouping property. The x-axis should always be 11/54 no matter the grouping and the grouping sort direction which should only affect the sorting within the column and not across all of the columns since some columns might not have the data being sorted in each column.

 

Thank you for your time and assistance.

0
Accepted
Iliana Dyankova
Telerik team
answered on 21 Jul 2016, 06:25 AM
Hi David,

I see what you mean. In order to get this outcome you should sort the categories in the dataBound event. Take a look at the updated dojo and let me know if this fits the current requirements.

Regards,
Iliana Nikolova
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
David
Top achievements
Rank 1
answered on 21 Jul 2016, 01:42 PM
Thanks. That's exactly what I was looking for.
Tags
Charts
Asked by
David
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
David
Top achievements
Rank 1
Share this question
or