Results 1 to 6 of 6

Thread: Dynamic json chart

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Apr 2010
    Posts
    7
    Vote Rating
    0
      0  

    Default Dynamic json chart

    I'm trying to use Sencha Touch Charts with a JSONStore to dynamically display a chart from information provided by JSON, series and data. This was possible with ExtJS 3 with the metaData property.


    How can I accomplish the same with Sencha Touch Charts?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Load the store outside the chart and when the store loads, create the chart.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Posts
    7
    Vote Rating
    0
      0  

    Default

    I'm sorry but I can't get it to work. A simple example would be nice.

    I wan't someting like this to produce a chart, none of the fields (except timestamp) can be hardcoded because it needs to be fullt dynamic.

    Code:
    {    "metaData": {
            "root": "series",
            "fields": [{
                "name": "timestamp"
            }, {
                "name": "Unit 1",
                "mapping": 2345
            }, {
                "name": "Unit 2",
                "mapping": 5647
            }, {
                "name": "Unit 3",
                "mapping": 1436
            }]
        },
        "series": [{
            "timestamp": "Jan",
            "1436": 10,
            "5647": 6,
            "2345": 4
        }, {
            "timestamp": "Feb",
            "2345": 10,
            "1436": 9,
            "5647": 7
        }, {
            "timestamp": "Mar",
            "2345": 10,
            "5647": 7,
            "1436": 4
        }]
    }

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Location
    India
    Posts
    25
    Answers
    1
    Vote Rating
    0
      0  

    Default

    What if i want the labels also to be dynamic not hard coded?

    How do i refresh and reload the data. Say i reload the store with new data. How do i rerender the chart.

  5. #5
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Quote Originally Posted by m4manas View Post
    What if i want the labels also to be dynamic not hard coded?

    How do i refresh and reload the data. Say i reload the store with new data. How do i rerender the chart.
    The chart should hear when the store loads. The examples have a refresh button that simulates this.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  6. #6
    Sencha User
    Join Date
    Jul 2009
    Posts
    15
    Answers
    1
    Vote Rating
    1
      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    The chart should hear when the store loads. The examples have a refresh button that simulates this.
    @simon i am afraid then when a store calls a loadData the chart is refreshed but it does not update the series in the charts and so if we have added a new data or field in the store then the chart does not reflect this change is only redraws or refreshes the chart with same old store data..

    i tries this with sencha 4.0.1 charts and also on touch chars

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •