We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Order the bar chart by it's value

Thread ID:

Created:

Updated:

Platform:

Replies:

132213 Aug 21,2017 09:35 AM UTC Aug 25,2017 11:40 AM UTC WinForms 3
loading
Tags: Chart
Caraka Wedhatama
Asked On August 21, 2017 09:35 AM UTC

Hi, i have a list of object contains "Item name" and "Quantity". When i bind that object to a bar chart, the chart is ordered by Item name.
Even though i've ordered the list by quantity, it still ordered by item name on the chart. What should i do if i want the chart is ordered by quantity ?

I'm using syncfusion essential studio 14.4.0.15 by the way.

Thank you ! :)

Dharanidharan Dharmasivam [Syncfusion]
Replied On August 22, 2017 12:21 PM UTC

Hi Caraka, 

Thanks for contacting Syncfusion support. 

We have analyzed your query. Your requirement can be achieved by using SortBy property of series. In this enum property you can specify either X or Y with respect to which you need to sort the points. This is applicable only if you render the x axis as category, since if you render in double it will render linearly and will not able to sort it. Find the code snippet below to achieve this requirement. 
 
Windows Forms: 

series1.SortBy = ChartSeriesSortingType.Y; 
series1.Points.Add("Server 1", 256); 
series1.Points.Add("Server 2", 351); 
series1.Points.Add("Server 3", 210); 
series1.Points.Add("Server 4", 200); 
series1.Points.Add("Server 5", 240); 


Screenshot for sorting with respect to Y: 
 

Sorting with respect to X: 
 
 
Sample for reference can be find from below link.
http://www.syncfusion.com/downloads/support/forum/132213/ze/sorting2136586753  

Thanks, 
Dharani. 


Caraka Wedhatama
Replied On August 25, 2017 08:56 AM UTC

Hi Dharanidharan Dharmasivam,

That solved my case. Thank's a lot :)


Preethi Nesakkan Gnanadurai [Syncfusion]
Replied On August 25, 2017 11:40 AM UTC

Hi Caraka,  
  
Most Welcome. 
  
Please let us know if you need any further assistance. 
  
Regards,  
Preethi 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;