-
10 Apr 2012 5:02 AM #1
Answered: Installing Charts with Sencha touch 2
Answered: Installing Charts with Sencha touch 2
Please post some step by step instructions to use charts with an existing sencha touch 2 project. Please assume we are beginners... I have tried many of the solutions posted here and there with no success. Please describe best practices. Please describe directory structures, where charts go, where scss go etc. Do we need to edit our config.rb file in the app resources folder? Does the charts install keep it's own directories and config for scss? So many questions, so few answers... Want to buy it for my work project, but not without any good documentation to install it...
Thanks!
-
Best Answer Posted by mitchellsimoens
If you are using Sencha Command then you should use the sencha-touch.js that comes with the touch charts in app.json. Also in app.json you can add touch-charts.js. After that it's just a matter of getting the SASS in there.
-
10 Apr 2012 7:52 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
If you are using Sencha Command then you should use the sencha-touch.js that comes with the touch charts in app.json. Also in app.json you can add touch-charts.js. After that it's just a matter of getting the SASS in there.
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.
-
16 Apr 2012 6:51 AM #3
Do you mean switch the sencha-touch.js file from the regular sencha-touch to the sencha-touch.js that is inside the charts package, BEFORE running a command like sencha app create... or do you mean running the command for creating the app, then switching the libs? And do I need to switch the other lib sencha-touch-debug.js ?
Thank you very much for your help and patience.
Regis
-
16 Apr 2012 7:00 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
You would need to change app.json after you do the app create.
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.
-
16 Apr 2012 8:07 AM #5
Still not working...
Still not working...
Oh - ok, I understand. Sorry to be so slow... I am not physically moving any files, but linking to the sencha-touch library that is shipped with touch-charts by changing the ref in app.json of my newly created app. Just so we are on the same page, here is what I did.
- Opened Terminal window and cd /path/to/sencha/touch/2
- ran: sencha app create Myapp ../myapp
- tested the app, worked well with the generic code created by Sencha
- edited app.json: commented out and addedCode:
"path": "sdk/sencha-touch.js"
Code:"path": "../touch-charts/sencha-touch.js"
- tested the app again, getting the following error: Uncaught TypeError: Cannot call method 'setPath' of undefined in app.js line 2
then I get the following errors:Code://"path": "sdk/sencha-touch.js" "path": "../touch-charts/sencha-touch.js", "path": "../touch-charts/touch-charts.js"
Uncaught ReferenceError: Ext is not defined ... in touch-charts.js:1
Uncaught ReferenceError: Ext is not defined ... in app.js:2
What am I doing wrong?
-
16 Apr 2012 8:12 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
In my app.json, I have this:
Code:"js": [ { //"path": "sdk/sencha-touch.js" "path" : "assets/charts-2.0.0/sencha-touch-debug.js" }, { "path" : "assets/charts-2.0.0/touch-charts.js" }, { "path": "app.js", "update": "delta" } ],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.
-
16 Apr 2012 8:20 AM #7
I did organize the libs in an 'assets' folder just like you showed above, and still get the same error. I am noticing that you are linking to charts v 2.0.0, the download link I got from the sencha website is v 1.0.0, would that be the problem?
Edit: I searched the web for touch-charts 2.0.0 and found a beta version, with which I do not get any errors. (2.0.0-beta). Is this the latest version?
-
16 Apr 2012 8:32 AM #8
-
16 Apr 2012 8:33 AM #9Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
Correct, Touch Charts 2 beta is the latest release.
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