Results 1 to 5 of 5

Thread: Sort X axis on MsChart with multiple series

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2007
    Posts
    106

    Sort X axis on MsChart with multiple series

    Hello,

    i have an MsChart with 6 series. The data is retrieved from MySQL database and every series has different number of elements.

    The X axis is represented by date values (YYYY-MM). I am sorting data ASC on date from MySQL query but when i generate the chart i have the values (from left to right) : 2010-01 , 2011-04, 2013-04, 2011-04,2012-04.

    I tryed sorting data like this , for every series:

    Code:
    Chart1.Series(0).Sort(PointSortOrder.Ascending, "X")
    But still no effect.


    How can i sort data on X axis?


    Thank you!

  2. #2
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Sort X axis on MsChart with multiple series

    Hey,

    Is it possible that you can show us some more of the code, or aspx markup, that you are using?

    I would have though ascending date from left to right, would have been the default. I wouldn't have thought you would have had to do anything.

    Gary

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2007
    Posts
    106

    Re: Sort X axis on MsChart with multiple series

    When i use just one series the chart displays correctly.

    Chart1.Series(0).Points.DataBindXY(data_array_here, counter_for_data_array_here)

    but when i put a second series to the chart,the same way as above (but with different sizes and values for the arrays, the x axis is not sorted any more.
    Data is retrieved from MySQL database.

  4. #4
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Sort X axis on MsChart with multiple series

    Is it possible that you can show a screenshot of it working with 1 series, and then not with 2?

    Gary

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2007
    Posts
    106

    Re: Sort X axis on MsChart with multiple series

    Name:  two.jpg
Views: 1372
Size:  64.5 KBName:  one.jpg
Views: 1396
Size:  56.5 KB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width