This is a migrated thread and some comments may be shown as answers.

StackedBar in codebehind for dynamic columns

1 Answer 37 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 02 Dec 2011, 10:05 PM
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

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 07 Dec 2011, 01:42 PM
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,
Tsvetie
the Telerik team

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

Tags
Chart
Asked by
Shaun
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or