How to sort RadChart's XCategorys

5 posts, 0 answers
  1. Sean
    Sean avatar
    13 posts
    Member since:
    Feb 2009

    Posted 30 Sep 2010 Link to this post

    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
  2. Sean
    Sean avatar
    13 posts
    Member since:
    Feb 2009

    Posted 05 Oct 2010 Link to this post

    Is anyone else seeing this?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sean
    Sean avatar
    13 posts
    Member since:
    Feb 2009

    Posted 06 Oct 2010 Link to this post

    Problem solved.
  5. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 06 Oct 2010 Link to this post

    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
  6. Michel
    Michel avatar
    39 posts
    Member since:
    Jul 2011

    Posted 26 Mar 2012 Link to this post

    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







Back to Top
UI for WPF is Visual Studio 2017 Ready