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

Stacked Bar Chart Issue

Explorer ,
Mar 22, 2012 Mar 22, 2012

Copy link to clipboard

Copied

Hello, with ColdFusion 8 this code produces duplicate stacked bars. The two chartseries are required to produce the stacked affect. One bar stack is labeled "Programs" and the second is labeled "Enrolled Programs". They are identical and both contain the data I wish to display so obviously I only want one of them. Suggestions? Thanks.

<cfchart format="flash" showlegend="yes"

      chartheight="350"

      chartwidth="350"

      showxgridlines="no"

      showygridlines="no" 

      showborder="no"

      fontsize="12"

      fontbold="no"

      fontitalic="no"

      xaxistitle=""

      yaxistitle="Count"

      show3d="yes"

      rotated="no"

      sortxaxis="no"

      showmarkers="yes" seriesplacement="stacked">

      <cfchartseries type="bar" query="qAllProgramsCount" seriescolor="blue" itemcolumn="title" valuecolumn="prgCount" serieslabel="Programs" >

      <cfchartseries type="bar" query="qEnrolled" seriescolor="red" itemcolumn="title" valuecolumn="prgCount" serieslabel="Enrolled Programs" >  

</cfchart>

TOPICS
Reporting

Views

2.1K

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 , Mar 22, 2012 Mar 22, 2012

It never fails that as soon as I post a question I figure it out...anyway, it was differenciating on the "title" in my two queries. I made them the same and viola, one bar! Hope this helps someone.

Votes

Translate

Translate
Explorer ,
Mar 22, 2012 Mar 22, 2012

Copy link to clipboard

Copied

It never fails that as soon as I post a question I figure it out...anyway, it was differenciating on the "title" in my two queries. I made them the same and viola, one bar! Hope this helps someone.

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
Explorer ,
Apr 02, 2012 Apr 02, 2012

Copy link to clipboard

Copied

I also figured out that the query data must be arranged in columns not rows. At first I had the values for each stack piece on a separate row. This would work for a single bar but adding multiple bars would just duplicate the first. The trick was each bar should be a single row with each piece of the stack a separate column. Once I put the survey response counts into columns I could feed the query into the chartseries like so and I got the desired stacked bar chart for each subquestion.

<cfchartseries type="bar" query="qChartData" seriescolor="red" itemcolumn="subquestion" valuecolumn="disagree" serieslabel="Disagree" > </cfchartseries>

<cfchartseries type="bar" query="qChartData" seriescolor="yellow" itemcolumn="subquestion" valuecolumn="somewhatagree" serieslabel="Somewhat Agree"></cfchartseries>     

<cfchartseries type="bar" query="qChartData" seriescolor="green" itemcolumn="subquestion" valuecolumn="agree"  serieslabel="Agree" ></cfchartseries>

<cfchartseries type="bar" query="qChartData" seriescolor="blue" itemcolumn="subquestion" valuecolumn="stronglyagree" serieslabel="Strongly Agree" ></cfchartseries>

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
Community Expert ,
Apr 13, 2012 Apr 13, 2012

Copy link to clipboard

Copied

LATEST

berniemiller wrote:

It never fails that as soon as I post a question I figure it out...anyway, it was differenciating on the "title" in my two queries. I made them the same and viola, one bar! Hope this helps someone.

It surely will, if you mark the question as answered!

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