-
23 Nov 2012 12:33 AM #1
Use numeric value of nested json data in Extjs 4 chart
Use numeric value of nested json data in Extjs 4 chart
My json looks like this :
I'd like to get the "Week" values (1224,1225,1226) in the X axis of my chart. How can I do this please ?Code:{ "Week": [ 1224, { "Total_OUT3F": 12, "Sev_Logged": "3_major", "Total_OUT3A5": 3, "IN1": 36, "OUT3FA_5": 15, "Total_IN1": 36, "OUT3A_5": 3, "OUT3-Fix": 12 }, 1225, { "Total_OUT3F": 24, "Sev_Logged": "3_major", "Total_OUT3A5": 12, "IN1": 21, "OUT3FA_5": 21, "Total_IN1": 57, "OUT3A_5": 9, "OUT3-Fix": 12 }, 1226, { "Total_OUT3F": 49, "Sev_Logged": "4_minor", "Total_OUT3A5": 17, "IN1": 40, "OUT3FA_5": 30, "Total_IN1": 97, "OUT3A_5": 5, "OUT3-Fix": 25 }]}
This is my model :
In my Chart js file, I putCode:Ext.define('Metrics.model.GraphData', { extend: 'Ext.data.Model', fields: ['Week', 'OUT3FA_5','OUT3A_5','IN1','OUT3-Fix','Total_IN1','Total_OUT3F','Total_OUT3A5'] });but it doesn't take the numeric values.Code:xField = 'Week'
Please any help would be appreciated.
-
26 Nov 2012 8:11 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
The week number needs to be within the object
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.


Reply With Quote