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

CFCHART and CFQUERY problem :(

Engaged ,
Jan 31, 2012 Jan 31, 2012

Copy link to clipboard

Copied

Hi,

I'm trying to use <cfchart> to create a pie chart from a query that shows 3 wedges with 3 different values.  I can't for the life of me figure out how to do this.  Here is my code:

<cfchart format="png"  chartheight="150"   chartwidth="200">

    <cfchartseries type="pie" query="qCompanyStatus">

</cfchart>

The query returns 1 row with 4 columns

CompanyName | NumberStarted | NumberInProgress | NumberComplete

ABC Company, 4, 5, 9

I'd like to display a pie chart with three wedges showing the values in each of these columns.

How can I do this?  It seems there is only an itemcolumn and valuecolumn, I need to display multiple values here and just not sure how to do it.  It must be something simple.


Any help highly appreciated...

Thanks

TOPICS
Advanced techniques

Views

680

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

Valorous Hero , Feb 01, 2012 Feb 01, 2012

1) Generate the cfchartdata elements yourself

<cfchartseries type="pie">

    <cfloop query="qCompanyStatus">

        <cfchartdata  item="#CompanyName#" value="#NumberStarted#">

        <cfchartdata  item="#CompanyName#" value="#NumberInProgress#">

         ....

    </cfloop>

</cfchartseries>

2) Reformat the query results to return a single value column.

ABC Company, 4

ABC Company, 5

ABC Company, 9

Votes

Translate

Translate
Valorous Hero ,
Feb 01, 2012 Feb 01, 2012

Copy link to clipboard

Copied

1) Generate the cfchartdata elements yourself

<cfchartseries type="pie">

    <cfloop query="qCompanyStatus">

        <cfchartdata  item="#CompanyName#" value="#NumberStarted#">

        <cfchartdata  item="#CompanyName#" value="#NumberInProgress#">

         ....

    </cfloop>

</cfchartseries>

2) Reformat the query results to return a single value column.

ABC Company, 4

ABC Company, 5

ABC Company, 9

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
Engaged ,
Feb 01, 2012 Feb 01, 2012

Copy link to clipboard

Copied

LATEST

Thanks.. that worked.   Appreciated very much!

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