1 Reply Latest reply on May 25, 2006 10:40 AM by muellertj

    cfchartseries seriescolor specifications

    muellertj
      I am trying to color bars different colors based on their value but it appears as though I can't use a cfif statement in the cfchartseries tag. Does anyone haave any ideas on how I can work around this to color the bars different colors?

      I get this error: Invalid token 'c' found on line....

      This is what I tried and failed with:
      <cfchartseries query="chartdata" type="bar" valuecolumn="drymatter" itemcolumn="paddock"
      <cfif chartdata.drymatter GTE 2750>seriescolor="red"
      <cfelseif chartdata.drymatter LTE 1100>seriescolor="yellow"
      <cfelse>seriescolor="green"
      </cfif>>
      </cfchartseries>
        • 1. Re: cfchartseries seriescolor specifications
          muellertj Level 1
          I found a way around this.
          I ended up creating three queries one for >2750, one for <1100, and one for <=2750 and >=1100.
          Then I created three chartseries for each query and colored them accordingly.
          I have included the cfchart code below.

          <cfchart style="chart.xml" chartheight="350" chartwidth="600">
          <cfchartseries
          query="chartdata2750"
          type="bar"
          valuecolumn="drymatter"
          itemcolumn="paddock"
          seriescolor="red">
          </cfchartseries>
          <cfchartseries
          query="chartdata"
          type="bar"
          valuecolumn="drymatter"
          itemcolumn="paddock"
          seriescolor="green">
          </cfchartseries>
          <cfchartseries
          query="chartdata1100"
          type="bar"
          valuecolumn="drymatter"
          itemcolumn="paddock"
          seriescolor="yellow">
          </cfchartseries>
          </cfchart>