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

Stacked column chart where group is a property

2 Answers 104 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 13 Feb 2014, 05:21 PM
Please see this jsbin:
http://jsbin.com/kizuy/2/edit

My data is in the form:
​ [{"name":"General","monthEnd":"2013-12-31T00:00:00","balance":50.00},
{"name":"Special","monthEnd":"2013-12-31T00:00:00","balance":120.00},
{"name":"Savings","monthEnd":"2013-12-31T00:00:00","balance":20.00},
{"name":"General","monthEnd":"2014-01-31T00:00:00","balance":100.00},
{"name":"Special","monthEnd":"2014-01-31T00:00:00","balance":120.00},
{"name":"Savings","monthEnd":"2014-01-31T00:00:00","balance":50.00}]


I would like a stacked bar chart that shows the months on the x axis, and stacked columns for the balance, where each portion of the total column is based on the name field.  The end user controls the name, so I can't define the stacked groups statically.  The current JSBin shows the max balance value for each date (which I know is the default aggregation), rather than a stack of the total.

I have ensured that the data source contains the same number of data points for each group and date.  Most of the examples have data in a different structure (values are all together, separate from the categories).

Is there any way to achieve the desired stacked column chart?

2 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 17 Feb 2014, 01:19 PM
Hi Darren,

If I understand correctly this scenario you would like to stack the "General", "Special" and "Savings" values for each of the "monthEnd"? If this is the case you could group the dataSource (updated jsBin example). In case I am missing something please elaborate a bit more on the exact outcome you would like to achieve - this way I would be able to advice you further and provide concrete recommendations. 

Regards,
Iliana Nikolova
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
Darren
Top achievements
Rank 1
answered on 19 Feb 2014, 10:34 PM
Iliana,
That was exactly what I was looking for.  I think that I tried everything except making it a dataSource.  I am receiving the data from a separate AJAX request (so that I have more control over the send/receive), and was trying to simply use the array data as the chart source directly.  I will attempt to update my project with this approach and I expect it will work.

Thank you.
Tags
Charts
Asked by
Darren
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Darren
Top achievements
Rank 1
Share this question
or