4 Replies Latest reply on Jun 4, 2009 3:27 AM by KalavatiSingh

    creating graphs

    KalavatiSingh

      Hi,

             I have a current requirement where i need to create  graphs in Flex .The input to this graph (Line graph) comes through a CSV file.any help /examples  are invited.

       

       

      Regards

      Kalavati

        • 1. Re: creating graphs
          Richard_Abbott Level 3

          Hi Kalavati,

          you will need the full version of Flex Builder to get the charts (and other data-handling stuff like the advanced data grid). Assuming that is OK, then the examples in the Adobe documentation are pretty good for this. However, the main hurdle you will face is the one of getting your data into the right format. You say it is in CSV at the moment, but all the charts expect a data provider in one of the more useful formats, usually either as ArrayCollection or XML/XMLList. If I were you I would make sure my chart works by following one of the examples, such as the one at the end of

          http://www.adobe.com/livedocs/flex/3/langref/mx/charts/LineChart.html

          which just hard-codes data into an ArrayCollection within the Flex code.

          Then work on some code that parses the CSV into an ArrayCollection and change the data provider to match. Basically this would split the whole lot first into lines (split on new line) and then each line into cell values (split on comma). The individual values get put into the ArrayCollection.

          Personally I'd be using XML rather than ArrayCollection, as that gives you a lot of other ability to manipulate the data, but you may not need to do that in the context of your project, and the above steps should get you well on the way.

          Richard

          • 2. Re: creating graphs
            KalavatiSingh Level 1

            Hi Richard,

                    Thank you very much.Have got any idea with as3xls package((http://code.google.com/p/as3xls/).Can this help me with parsing a CSV in Flex.

             

             

            Regards

            Kalavati

                                                    

            • 3. Re: creating graphs
              KalavatiSingh Level 1

              Hi Richard,

                   We are currently using Flex Builder Standard Edition is that OK or should we go for a prefessional Edition

               

               

              Regards

              Kalavati

              • 4. Re: creating graphs
                Richard_Abbott Level 3

                Hi Kalavati,

                I had not heard of this package until your email, but looking at it then it does rather more than you need it to, as it is focused more on accessing the object model for Excel (which is very complicated!). If you only need to work with CSV files rather than XLS then I would recommend just writing a small parser yourself. However, if you anticipate a future need to deal with XLS, then maybe it would be good.

                Re the version, I thought the charts and other advanced data stuff was only available in professional, not standard.

                Richard