StackedBar in codebehind for dynamic columns

2 posts, 0 answers
  1. NK
    NK avatar
    15 posts
    Member since:
    Nov 2011

    Posted 02 Dec 2011 Link to this post

    I've been struggling to create a stacked bar chart with that will display the following data:

    I realize that since the columns (years) are dynamic that i must create the chart in codebehind. However, I've been lost with trying to figure out how to loop through the data (in the form of a datatable, that looks exactly like the grid in the screenshot above) and what item mappings and/or groupsettings to specifiy.  Any help with figuring this out would be most appreciated! Thanks

  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 07 Dec 2011 Link to this post

    Hi Nk,
    I could not quite understand why you need to create the chart in code-behind or the problem that you encountered while you were trying to create it. Basically, what you need to do, is create the appropriate SeriesMapping and supply the data to the chart control.

    Please note that in this case, you need to use a categorical x-axis.

    In case you need additional help with that, please open a formal support ticket and send us a simple running project that demonstrates your setup, as well as detailed information on the current and expected results.

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top