-
13 Nov 2012 7:57 AM #1
Unanswered: Column Chart axes does not render properly
Unanswered: Column Chart axes does not render properly
I have the following json data:
{data: [
{ "name": "Thu", "failure": 0, "success": 0},
{ "name": "Wed", "failure": 0, "success": 0},
{ "name": "Tue", "failure": 0, "success": 3},
{ "name": "Mon", "failure": 0, "success": 0},
{ "name": "Sun", "failure": 0, "success": 3},
{ "name": "Sat", "failure": 0, "success": 0},
{ "name": "Fri", "failure": 0, "success": 0}
]
}
When the column chart is rendered, the axes is not numbered correctly. What might be wrong? The code for the chart is:
I have also attached an example snapshot.Code:ch= Ext.create('Ext.chart.Chart', { width: 600, height: 300, region: 'center', insetPadding: 80, theme: 'Coloredlegend', //this is to set the green and red colors for the success and failure animate: true, store: store, legend: { position: 'right', yField: 'success', //style: {color: 0x34ff0a}, yField: 'failure', //style: {color: 0xd4ff51}, }, axes: [ { type: 'Numeric', position: 'left', fields: ['failure'], label: { renderer: Ext.util.Format.numberRenderer('0,0') }, title: 'Failed Data', minimum: 0 }, { type: 'Numeric', position: 'left', fields: ['success'], label: { renderer: Ext.util.Format.numberRenderer('0,0') }, title: 'Test', grid: true, minimum: 0 }, { type: 'Category', position: 'bottom', fields: ['name'], } ], series: [ { type: 'column', axis: 'left', highlight: true, tips: { trackMouse: true, width: 140, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('name') + ': ' + item.value[1]); } }, label: { display: 'insideEnd', 'text-anchor': 'middle', field: ['success', 'failure'], renderer: Ext.util.Format.numberRenderer('0'), orientation: 'vertical', color: '#333' }, xField: 'name', yField: ['success','failure'], showInLegend: true, }, ] });
-
15 Nov 2012 6:29 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3107
What Ext JS 4 version are you using?
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.
-
15 Nov 2012 6:51 AM #3


Reply With Quote