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

How to sort RadChart's XCategorys

4 Answers 119 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 30 Sep 2010, 06:24 PM
Hello,

I am trying to read in a bunch of data from a stored procedure and I build out multiple data series in the same order that it was received from the stored procedure. The problem lies in that the order of the data from the stored procedure is not the same order that RadChart renders the XCategories. For instance, I am reading in the XCategory's as Apr-2009, June-2009... till now. But the XCategory's wind up being alphabetized rather than ordered by the order specified in the stored procedure. Is there a good way to re-order the XCategories so they appear chronologically?

Thanks,
Sean

4 Answers, 1 is accepted

Sort by
0
Sean
Top achievements
Rank 1
answered on 05 Oct 2010, 10:39 PM
Is anyone else seeing this?
0
Sean
Top achievements
Rank 1
answered on 06 Oct 2010, 04:45 PM
Problem solved.
0
Vladimir Milev
Telerik team
answered on 06 Oct 2010, 05:21 PM
Hi Sean,

It is currently not possible to sort the categories. RadChart does not know how to sort a list of strings apart from the obvious (and mostly useless) alphabetical sorting. Therefore RadChart does not use any sorting at all. The XAxis labels are displayed in the same order as they occur in the data. If you need to enforce strict ordering of items on the XAxis please consider using XValues instead of XCategories.

Best wishes,
Vladimir Milev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michel
Top achievements
Rank 1
answered on 26 Mar 2012, 10:01 PM
Hi !

We are experiencing a related problem...

You stated "The XAxis labels are displayed in the same order as they occur in the data." in your reply but ths is not what we are seeing:

Consider both the following example data where we have 3 columns: WeekNumber, ItemName, Value
2012-12 item2 20488.2
2012-13 item1 -443.9 2012-13 item1 -443.9
2012-13 item2 456.3 2012-13 item2 20944.5
2012-14 item1 -887.8 2012-14 item1 -887.8
2012-14 item2 3333 2012-14 item2 23821.2
2012-15 item1 -1331.7 2012-15 item1 -1331.7
2012-16 item1 -1775.6 2012-16 item1 -1775.6
2012-16 item2 8888 2012-16 item2 29376.2
2012-17 item1 -2219.5

When using the data on the left, WeekNumbers are displayed correctly along the bottom x axis.

When using the data on the right, WeekNumber "2012-15" for "item1" is displayed AFTER "2012-16" for "item2" along the bottom...

Is this problem has been fixed in the latest version we are supposed to get within a few weeks ?

Thanks !

Michel







Tags
Chart
Asked by
Sean
Top achievements
Rank 1
Answers by
Sean
Top achievements
Rank 1
Vladimir Milev
Telerik team
Michel
Top achievements
Rank 1
Share this question
or