Results 1 to 2 of 2

Thread: Split data from JSON for chart

  1. #1
    Sencha Premium Member
    Join Date
    Feb 2015
    Posts
    17
    Vote Rating
    1
      0  

    Default Split data from JSON for chart

    Hi,

    I want to send data down to a chart that has some filter info (that I'll put in the chart title) and the actual data.
    Code:
    {
      "data": [
        {
          "scale": -3,
          "measure": "Basic Tee",
          "value": 101740.90661659864
        },
        {
          "scale": -3,
          "measure": "Fashion Knit Tops",
          "value": 81559.21146309843
        },
        {
          "scale": -3,
          "measure": "Polo Shirts",
          "value": 34743.9764527008
        }
      ],
      "filter": {
        "test": "testing"
      }
    }
    If i set the root for the proxy I can get the data fine but not the filter.

    Code:
    reader: {
        type: 'json'
    , root: 'data' 
    },
    How do I get access to both?

    Thanks

    lee

  2. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446
    Vote Rating
    187
      1  

    Default

    Hi--

    One way you can do this is to retrieve the data from the proxy's reader. Here's an example:

    https://fiddle.sencha.com/#fiddle/o15

    You could additionally load the data via Ext.Ajax.request(...), and then load the store with the data when the request is received, storing both sets of data however you'd like within your application.

    I hope that helps!
    Thanks
    Joel

Similar Threads

  1. Weird Chart result from JSON data
    By mattluurocks in forum Sencha Architect 3.x: Q&A
    Replies: 4
    Last Post: 19 Nov 2013, 12:25 AM
  2. Problems with Radar Chart, when data is JSON
    By Evolic in forum Ext: Q&A
    Replies: 6
    Last Post: 23 Aug 2012, 5:47 AM
  3. stock chart json data from asp.net problem
    By xnoor in forum Ext: Discussion
    Replies: 4
    Last Post: 8 Mar 2012, 12:29 PM
  4. Help Display Chart with same Data in JSON
    By ridhopahwanae in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 16 Jun 2010, 6:00 PM
  5. [RESOLVED] Json data for chart
    By senacle in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 20 Aug 2009, 8:05 AM

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
  •