3 Replies Latest reply on Jul 31, 2009 4:05 AM by Richard_Abbott

    Developing  a Graph

    KalavatiSingh Level 1

      Hi,

          According to my current requirement I need to design a graph where Lower level (amplitude) signals are shown in green, middle level signals in  yellow and high level signals in red.  Can this be implemented easily using the  Flex-based graphing routines? I request you forward any suggestions/examples/docs in regardance to this.Let me know if you need any further details on it

       

       

      Regards

      Kalavati Singh

      kalavati_singh@yahoo.co.in

        • 1. Re: Developing  a Graph
          Richard_Abbott Level 3

          Kalavati,

          you don;t say what kind of chart you are using, but yes there are ways of doing this. If you are using a bar or column chart then you can assign a fill function that determines an appropriate colour for the bar based on the data value - see the Adobe doc

          http://www.adobe.com/livedocs/flex/3/html/help.html?content=charts_displayingdata_09.html

          for some examples. This can be done in MXML or ActionScript.

          If you are using a line graph then you will need to do something similar but with Stroke colours: I have never tried this out and it looks slightly more fiddly but should be achievable.

          Richard

          • 2. Re: Developing  a Graph
            KalavatiSingh Level 1

            Hi,

                Thank you Richard for the link. According to my requirement i need to go for a line chart &  its basically  frequency scanner i have develop.So if the area falling in low frequency to be dispalyed as green medim level yellow & above that it must be red.Can i get some more inputs  on it.

             

             

             

             

            Regards

            Kalavati Singh

            kalavati_singh@yahoo.co.in

            • 3. Re: Developing  a Graph
              Richard_Abbott Level 3

              Hi Kalavati,

              looking at the docs, there doesn't seem to be an easy way to do different line-segment colours with a line series. So... how about using an area series which _does_ have a fill function property? You do not need to colour in the whole area below the line as there is a minField property that gives you the lower limit of the area just like yField gives you the upper limit. So just as a quick suggestion, set up your data provider with two fields instead of one for y-values, the first being the one you want, and the second one say 10 units (or whatever is sensible) less than the first. Turn the stroke off by setting it to zero width, and use the fillFunction property to colour the area red/yellow/green depending on the value of y.

              Richard