-
7 Feb 2012 1:31 AM #1
Unanswered: How to create a stacked and grouped column chart?
Unanswered: How to create a stacked and grouped column chart?
In our application, we need to display column charts in such a way that we need to use the property of both stacked and group. That is, few bars will appear paraller to each other and every bar will also have stacks present in it something similar to this - http://www.highcharts.com/demo/colum...ed-and-grouped
The issue in this is that as soon as stacked:true property is added to the series of charts, the grouping dies.
Has anyone given a try to this and is this currently feasible?
Any help would be greatly appreciated.
Thanks
PS: We are using ExtJS 4.0.7
-
7 Feb 2012 6:34 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
This is using the Stacked Bar chart example that I modified to be a stacked column chart
Code:var store = Ext.create('Ext.data.JsonStore', { fields: ['year', 'comedy', 'action', 'drama', 'thriller'], data: [ {year: 2005, comedy: 34000000, action: 23890000, drama: 18450000, thriller: 20060000}, {year: 2006, comedy: 56703000, action: 38900000, drama: 12650000, thriller: 21000000}, {year: 2007, comedy: 42100000, action: 50410000, drama: 25780000, thriller: 23040000}, {year: 2008, comedy: 38910000, action: 56070000, drama: 24810000, thriller: 26940000} ] }); var panel1 = Ext.create('widget.panel', { width: 800, height: 400, title: 'Stacked Bar Chart - Movies by Genre', renderTo: Ext.getBody(), layout: 'fit', items: { xtype: 'chart', animate: true, shadow: true, store: store, legend: { position: 'right' }, axes: [{ type: 'Numeric', position: 'left', fields: ['comedy', 'action', 'drama', 'thriller'], title: false, grid: true, label: { renderer: function(v) { return String(v).replace(/(.)00000$/, '.$1M'); } }, roundToDecimal: false }, { type: 'Category', position: 'bottom', fields: ['year'], title: false }], series: [{ type: 'column', axis: 'bottom', gutter: 80, xField: 'year', yField: ['comedy', 'action', 'drama', 'thriller'], stacked: true, tips: { trackMouse: true, width: 65, height: 28, renderer: function(storeItem, item) { this.setTitle(String(item.value[1] / 1000000) + 'M'); } } }] } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Feb 2012 10:00 AM #3
Thanks for sharing the code mitchellsimoens
Thanks for sharing the code mitchellsimoens
Thanks for the code mitchellsimoens. But in this code, unfortunately, 'grouping' is missing.
We too were successful in creating stacked column chart by using stacked:true, but there seems to be currently no way present to have both grouped as well as stacked charts as present at this link - http://www.highcharts.com/demo/column-stacked-and-grouped
Could you point us to something in this direction that how can we have both - grouped as well as stacked columns - present in the same chart.
Thanks again.
-
9 Feb 2012 5:12 AM #4
Looks like confirmed
Looks like confirmed
Seems to be confirmed that currently no stacked+grouped charts possible in ExtJS. Hoping to have it in the coming releases.
-
30 May 2012 6:25 PM #5
did you come up with a solution or did you end up using a charting library like highcharts or fusioncharts?


Reply With Quote