Rad Chart Stacked Bar Data Binding to Data Table

Thread is closed for posting
2 posts, 0 answers
  1. Moran
    Moran avatar
    1 posts
    Member since:
    May 2014

    Posted 04 May 2014 Link to this post

    After reading posts in different sited for hours, i couldn't find the problem in my code.
    I'm using telerik rad chart and need to create a stacked bar chart, according to this data table structure:

    Work Week         Product         Quantity
    201401               a                      10
    201401               a                      20
    201402               a                       5
    201402               b                      10
    201402               c                       6
    201418               a                      10
    201418               b                       25

    I know there is a similar question to this, and you referred them to:

    but its not helping. 
    My code is:

            RadChart1.DataSource = dataForGraph; //dataForGraph is a data table
            RadChart1.DataGroupColumn = "product";
            RadChart1.PlotArea.XAxis.DataLabelsColumn = "WW";
            RadChart1.Legend.Appearance.GroupNameFormat = "#NAME:#VALUE";
            foreach (ChartSeries s in RadChart1.Series)
                s.Type = ChartSeriesType.StackedBar;
    And the result is that the quantity is stacked in wrong places (for example quantity 25 is in 201401 instead of 201418)
    What am i doing wrong?


  2. Danail Vasilev
    Danail Vasilev avatar
    1502 posts

    Posted 07 May 2014 Link to this post

    Hello Moran,

    In order for the grouping functionality to be working as expected the categories in the data source field for each series must match. This is illustrated in the example of the mentioned help article.

    Danail Vasilev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top