-
31 Jan 2012 2:28 AM #1
Answered: Touch Charts Y-Axis showing 0 for all values
Answered: Touch Charts Y-Axis showing 0 for all values
Hi,
So I have a Sencha Touch Area Chart that I'm using. The chart uses data that it collects from a json file.
As of now, the chart displays correctly. But all the values in the Y-axis show up as 0.00
Im using the code from the EnergyApp example in touch charts.
What am I doing wrong ?? I know that values are going into the chart.
Here's the code for the chart :
Code:var areaChartProd = new Ext.chart.Chart({ id: 'prodArea', title: 'prodAreas', iconCls: 'area', cls: 'chartpanel', theme: 'Energy', interactions: ['reset', { type: 'panzoom', axes: { right: {} } }, { type: 'iteminfo', gesture: 'tap', listeners: { show: function(interaction, item, panel) { EnergyApp.popup(item, panel); } } }], animate: false, store: EnergyApp.stores.ChartStore, axes: [{ type: 'Numeric', position: 'right', minimum: 0, majorTickSteps : 10, minorTickSteps : 5, label: { renderer: EnergyApp.commify }, //adjustMinimumByMajorUnit: 0, fields: [….], title: 'Kilo Watts' }, { type: 'Category', position: 'bottom', fields: ['day'], title: 'Day', label: { rotate: { degrees: 45 } } }], legend: { position: Ext.is.Phone ? 'left' : 'top' }, series: [{ type: 'area', highlight: false, title: […..], axis: 'right', xField: 'day', yField: [….] }], listeners: { afterrender: function(me) { me.on('beforerefresh', function() { if (me.ownerCt.getActiveItem().id !== me.id) { return false; } }, me); } } });
-
Best Answer Posted by Sasha172
Ok I figured it out and got it working.
The part of the example code that says
doesnt work at all. Basically, Im not sure whether the values I'm passing are too small or what else the problem could be, but the .commify function is returning 0.00 for all the data i pass to it.Code:label: { renderer: EnergyApp.commify },
I just commented out that part of code… and Voilá everything falls into place and works great
-
31 Jan 2012 11:26 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
- Answers
- 3113
Not enough to help. If you just changed the example then it should be no problem.
Also, why are you adding a listener in the afterrender event? Can you just have the beforerefresh event listener outside like you have the afterrender event?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.
-
31 Jan 2012 10:32 PM #3
Ok I figured it out and got it working.
The part of the example code that says
doesnt work at all. Basically, Im not sure whether the values I'm passing are too small or what else the problem could be, but the .commify function is returning 0.00 for all the data i pass to it.Code:label: { renderer: EnergyApp.commify },
I just commented out that part of code… and Voilá everything falls into place and works great


Reply With Quote