-
14 Feb 2012 7:08 AM #1
Unanswered: Column chart with 2 Y axes
Unanswered: Column chart with 2 Y axes
Hi,
I'm trying to plot a column chart with 2 series and thus 2 Y axis, one in the left side and the other in the right side. But the columns display in the same place, on top of each others and not side by side. Do you have any idea how to fix this ?
Thanks
-
14 Feb 2012 8:10 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
Instead of two series, try specifying yField as an array:
Code:yField: ['data1', 'data2']
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.
-
14 Feb 2012 8:15 AM #3
I just tried but it doesnt work neither. The problem is when I try with 2 series, I actually have 2 series drawn, but they are drawn on top of each others, so one is hiding the other.
-
14 Feb 2012 8:18 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
I just tried that line of code in the column example of the touch charts and it worked as I would expect it. Each month had two columns next to each other.
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.
-
14 Feb 2012 8:22 AM #5
Can you show me the full code you tried please ?
-
14 Feb 2012 8:33 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
If you open the column example, scroll down and replace the yField with that array
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.
-
14 Feb 2012 8:45 AM #7
Yes what you said works, but what I'm trying to do is something like that :
Something with a right axis and a serie linked to this axis.Code:Ext.onReady(function () { var chart; chart = new Ext.chart.Chart({ width: 800, height: 600, animate: true, store: store1, renderTo: Ext.getBody(), shadow: true, axes: [{ type: 'Numeric', position: 'left', fields: ['data1'], label: { renderer: Ext.util.Format.numberRenderer('0,0') }, title: 'Number of Hits', grid: true, minimum: 0 }, { type: 'Category', position: 'bottom', fields: ['name'], title: 'Month of the Year' }, { type: 'Numeric', position: 'right', fields: ['data2'], title: 'Test' }], series: [{ type: 'column', axis: 'left', highlight: true, xField: 'name', yField: 'data1' }, { type: 'column', axis: 'right', xField: 'name', yField: 'data2' }] }); });
-
14 Feb 2012 8:48 AM #8Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
What you want is two columns side by side for one name correct? Using the yField as an array does just that.
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.
-
14 Feb 2012 8:50 AM #9
Yeah but I want one of them linked to the right axis, so I can have two different scales.
-
24 May 2012 2:25 AM #10
Hi, Trexx
did you got the solution of the same as i m looking for the same thing
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote