1 Reply Latest reply on Jul 30, 2008 7:29 AM by Newsgroup_User

    Multi Colored Line on a line chart

    krvssk Level 1
      Hi,
      I'm very much new to Flex. I would like to render a line chart where the line should be multi-colored. This is my actual requirement.

      My data is in an XML:
      <testresults min=90 max=95>
      <test>
      <name>Glucose</name>
      <when>08,22,2002,5,50</when>
      <value>90</value>
      </test>
      <test>
      <name>Glucose</name>
      <when>08,22,2008,5,50</when>
      <value>92</value>
      </test>
      <test>
      <name>Glucose</name>
      <when>08,24,2008,7,50</when>
      <value>84</value>
      </test>
      <test>
      <name>Glucose</name>
      <when>08,24,2008,20,50</when>
      <value>98</value>
      </test>
      <testresults>

      Horizontal Axis is a Datetime axis(mapped to <when> with a parse function) and the vertical axis is numeric axis(mapped to <value>).

      There will be a line rendered on the linechart with y-axis values 90,92,84,98. I would like to set the color of the line rendered with dark red and light red depending on the min and max intervals. That is the line rendered in the y-axis interval between 90 to 95 should be light red in color and above 95 or below 90 should be in dark red color.

      Can any body throw some light on this?

      Thanks in advance,
      chaits
        • 1. Re: Multi Colored Line on a line chart
          Level 7

          "krvssk" <webforumsuser@macromedia.com> wrote in message
          news:g6pitl$hfr$1@forums.macromedia.com...
          > Hi,
          > I'm very much new to Flex. I would like to render a line chart where the
          > line
          > should be multi-colored. This is my actual requirement.
          >
          > My data is in an XML:
          > <testresults min=90 max=95>
          > <test>
          > <name>Glucose</name>
          > <when>08,22,2002,5,50</when>
          > <value>90</value>
          > </test>
          > <test>
          > <name>Glucose</name>
          > <when>08,22,2008,5,50</when>
          > <value>92</value>
          > </test>
          > <test>
          > <name>Glucose</name>
          > <when>08,24,2008,7,50</when>
          > <value>84</value>
          > </test>
          > <test>
          > <name>Glucose</name>
          > <when>08,24,2008,20,50</when>
          > <value>98</value>
          > </test>
          > <testresults>
          >
          > Horizontal Axis is a Datetime axis(mapped to <when> with a parse function)
          > and
          > the vertical axis is numeric axis(mapped to <value>).
          >
          > There will be a line rendered on the linechart with y-axis values
          > 90,92,84,98.
          > I would like to set the color of the line rendered with dark red and light
          > red
          > depending on the min and max intervals. That is the line rendered in the
          > y-axis
          > interval between 90 to 95 should be light red in color and above 95 or
          > below 90
          > should be in dark red color.

          LineSeries objects take a stroke. A stroke does not have the properties to
          allow you to change its color. You might be able to fake something by
          extending LineSeries to allow you take some other kind of object that allows
          this, but you'd have to write that as well.

          HTH;

          Amy