Stacked Bar Series Order Problem

Thread is closed for posting
11 posts, 0 answers
  1. Ilya Peskov
    Ilya Peskov avatar
    6 posts
    Member since:
    Nov 2009

    Posted 04 Nov 2009 Link to this post

    I am using Telerik AJAX for ASP.NET v 2008.3.1125.35. And I am having problems with radchart control. For some reason series position is not consistent in the graph as you can see from attached image. In the first bar "Unknown" series is the third from the bottom, but for the fourth bar it is first from the bottom which seems wrong to me. I am using DataGroupColumn property to create series automatically from data that I am getting from database. Any suggestions?
  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 04 Nov 2009 Link to this post

    There might be an issue with how the chart is adding the items to a series - have you tried manually adding the series to see if that would change anything?
  3. Ilya Peskov
    Ilya Peskov avatar
    6 posts
    Member since:
    Nov 2009

    Posted 04 Nov 2009 Link to this post

    No I havent try that. I will try and we will see how it goes.
  4. Ilya Peskov
    Ilya Peskov avatar
    6 posts
    Member since:
    Nov 2009

    Posted 06 Nov 2009 Link to this post

    I think I have found what is causing this problem. The data that I am getting from db and binding to chart looks like that:

    Date Case Count Group Column

    05/01/2009 6 Female
    05/01/2009 4 Male
    05/01/2009 8 Other
    05/01/2009        11 Unknown
    06/01/2009 4 Female
    06/01/2009 3 Male
    06/01/2009 3 Unknown
    07/01/2009 6 Female
    07/01/2009 6 Male
    07/01/2009 5 Other
    07/01/2009 5 Unknown

    and I am using RadChart.DataGroupColumn = "GroupColumn" property so chart will create series for me automatically. It leads to inconsistency of series position as you can see from attached "wrongPosition.png" file.

    So I decided to manually inject a record for 06/01/2009 that will have some values for the "Other" gender so 06/01/200 will not miss 4th series value:

    Date Case Count Group Column

    05/01/2009 6 Female
    05/01/2009 4 Male
    05/01/2009 8 Other
    05/01/2009        11 Unknown
    06/01/2009 4 Female
    06/01/2009 3 Male
    06/01/2009 8 Other
    06/01/2009 3 Unknown
    07/01/2009 6 Female
    07/01/2009 6 Male
    07/01/2009 5 Other
    07/01/2009 5 Unknown

    and result is correct. All series are consistently positioned in graph as you can see from attached "rightPosition.png" file. Furthermore if will inject a record with values:
    06/01/2009 0 Other
    it is creating chart correctly.

    Is it a known bug? Is there an easy way of fixing this?
  5. Ilya Peskov
    Ilya Peskov avatar
    6 posts
    Member since:
    Nov 2009

    Posted 09 Nov 2009 Link to this post

    Anyone?
  6. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 09 Nov 2009 Link to this post

    I believe this is by design since you are specifically looking for Female/Male/Other/Unknown and then one of them is missing, thus 'causing the databinding to mess like you originally displayed. It seems as if you found the easiest solution - adding an entry for "Other" with a value of 0. I think you need to maintain this consistency to have the RadChart display correctly.
  7. Ilya Peskov
    Ilya Peskov avatar
    6 posts
    Member since:
    Nov 2009

    Posted 09 Nov 2009 Link to this post

    Ok, thanks.
  8. Greg M
    Greg M avatar
    3 posts
    Member since:
    Sep 2009

    Posted 06 Apr 2010 Link to this post

    Has this issue been fixed or are there any other workaround?  I am unable to insert records for no value entries due to the dynamicness of the data I am returning. I do not have a set list of group items and would have to parse for the greatness number of group items and try to back fill data. 

    I would think that the control should be smart enough to default no values entries to 0 instead of causing databinding to get all messed up.
  9. Ilya Peskov
    Ilya Peskov avatar
    6 posts
    Member since:
    Nov 2009

    Posted 16 Apr 2010 Link to this post

    No we didn't find any better solution for this particular version. I don't know but maybe Telerik fixed it in recent version of the product.
  10. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 19 Apr 2010 Link to this post

    Have you looked into using the ItemDataBound event of the RadChart and setting up an if-statement that will default a certain value to 0? You can see how this can potentially be implemented by looking at the code-behind files of this online demo.
  11. Greg M
    Greg M avatar
    3 posts
    Member since:
    Sep 2009

    Posted 19 Apr 2010 Link to this post

    Actually I have come up with a solution for this.. I am manually creating the ChartSeries and adding the ChartSeriesItems to them.  This was alot quicker and easier then trying to parse my generic 1 to N data for each series to try to match everything up.
Back to Top