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

Re-sorting 100% Stacked bar charts by value or percent

1 Answer 177 Views
Charts
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 28 Mar 2017, 01:22 AM

I am seeking an example that takes a simple 100% stacked bar chart like:

http://demos.telerik.com/kendo-ui/bar-charts/stacked100-bar

And adds a button or control that will re-sort it by Gold metal percent or by Gold metal count.  I haven't turned up anything in my searches of the telerik forums or on stacktrace.  Anyone make something comparable already?

Thanks,

Dave

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 29 Mar 2017, 11:45 AM
Hello David,

This can be achieved only if the Chart is connected to a dataSource as then the sort method of the dataSource can be used:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-sort

When the button is clicked the sort method can be called to sort by a specific field. The example demonstrates how to sort the Chart initially:

http://dojo.telerik.com/EyazO

I hope this will help to achieve the desired result.


Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
Charts
Asked by
David
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or