4 Replies Latest reply on Feb 24, 2009 5:58 PM by sig_UVA

    graphing from flat data

    sig_UVA
      I am looking through the graphing components that come with Flex and they seem straightforward. However, all of the examples use arrays as the data provider where calculations have already been performed. Data is rarely stored in the database that way, so I am wondering how users here obtain those types of values to put into their graphs.

      The database I am using to store this data (Quickbase) is only capable of serving up the XML in a flat structure. How would I perform calculations on this data? Should I create an new array by looping through the existing array collection? In Ruby, I've used hashes before, with the index being the value on which you group. I didn't think this was efficient though.

      As an example, I am trying to create a running total graph of number of employee hires by month.

      Thanks for your help!

        • 1. Re: graphing from flat data
          Level 7

          "sig_UVA" <webforumsuser@macromedia.com> wrote in message
          news:go1996$153$1@forums.macromedia.com...
          >I am looking through the graphing components that come with Flex and they
          >seem
          > straightforward. However, all of the examples use arrays as the data
          > provider
          > where calculations have already been performed. Data is rarely stored in
          > the
          > database that way, so I am wondering how users here obtain those types of
          > values to put into their graphs.
          >
          > The database I am using to store this data (Quickbase) is only capable of
          > serving up the XML in a flat structure. How would I perform calculations
          > on
          > this data? Should I create an new array by looping through the existing
          > array
          > collection? In Ruby, I've used hashes before, with the index being the
          > value on
          > which you group. I didn't think this was efficient though.

          I've never heard of a database that doesn't understand SQL.


          • 2. Re: graphing from flat data
            sig_UVA Level 1
            They abstract that kind of access from the user. Instead they have a report builder that is capable of returning the data as XML, but only flat data; no summaries or groupings.
            • 3. Re: graphing from flat data
              John Hall Level 4
              You could convert the returned flat structure to an IHierarchicalData type. Have you played with groupingCollections or hierarchicalData + hierarchicalDataView? If not, there's a ton of posts out there about converting XML to hierarchical data for dislaying in the advancedDataGrid. Even if you're not using the ADG and need charting stuff instead, most of the posts are related to converting flat data to hierarchical data for the data grid so google that.
              • 4. Re: graphing from flat data
                sig_UVA Level 1
                Thanks John. That's a good suggestion. I found a blog post here that looks promising. I'll post back here if I got it to work.