• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfchartseries seriescolor specifications

Explorer ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

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>
TOPICS
Advanced techniques

Views

228

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , May 25, 2006 May 25, 2006
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=...

Votes

Translate

Translate
Explorer ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

LATEST
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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation