1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    23
    Answers
    1
    Vote Rating
    2
    TheRegge is on a distinguished road

      0  

    Default 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!

  2. 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.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,617
    Answers
    3450
    Vote Rating
    818
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    23
    Answers
    1
    Vote Rating
    2
    TheRegge is on a distinguished road

      0  

    Default


    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

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,617
    Answers
    3450
    Vote Rating
    818
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You would need to change app.json after you do the app create.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Sencha User
    Join Date
    Aug 2010
    Posts
    23
    Answers
    1
    Vote Rating
    2
    TheRegge is on a distinguished road

      0  

    Default 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.
    1. Opened Terminal window and cd /path/to/sencha/touch/2
    2. ran: sencha app create Myapp ../myapp
    3. tested the app, worked well with the generic code created by Sencha
    4. edited app.json: commented out
      Code:
      "path": "sdk/sencha-touch.js"
      and added
      Code:
      "path": "../touch-charts/sencha-touch.js"
    5. tested the app again, getting the following error: Uncaught TypeError: Cannot call method 'setPath' of undefined in app.js line 2
    if, in addition of changing the path to sencha-touch.js, I add a path to touch-charts.js, turning the js section in app.json into this:
    Code:
    //"path": "sdk/sencha-touch.js"
    "path": "../touch-charts/sencha-touch.js",
    "path": "../touch-charts/touch-charts.js"
    then I get the following errors:
    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?

  7. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,617
    Answers
    3450
    Vote Rating
    818
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  8. #7
    Sencha User
    Join Date
    Aug 2010
    Posts
    23
    Answers
    1
    Vote Rating
    2
    TheRegge is on a distinguished road

      0  

    Default


    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?

  9. #8
    Sencha User
    Join Date
    Aug 2010
    Posts
    23
    Answers
    1
    Vote Rating
    2
    TheRegge is on a distinguished road

      0  

    Default


    Great, thank you!

  10. #9
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,617
    Answers
    3450
    Vote Rating
    818
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Correct, Touch Charts 2 beta is the latest release.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread