Highlighted

How to fix cfchartseries in coldfusion 11?

Community Beginner ,
Mar 10, 2016

Copy link to clipboard

Copied

Hello everyone, I'm trying to fix my cfchart in CF11 to look some similar like in previous CF9. I converted my .xml files and instead I use JSON to style my elements. Problem that I can not fix is cfchartseries. My data that i'm passing in my chartseries looks good, I tried to output everything on the screen before I tested my chart. In CF9 my Time records were displayed on the screen from the first value all the way up to the last value. Here is my screen shot of my chart in CF9:

CF9.png

As you can see on the picture above all my time slots are displayed on the screen in order from the lowest to the highest. Also my record for 2015 is displayed with the bar in blue color, 2016 in pink color. Now I will show you my chart with the exact same code in CF11:

CF11.png

You can see thatmy chart in CF11 starts with the blue bar that present year 2015 and time slot that should not be on the first spot 1415. Also my other time slots are not displayed on the screen. I have tried so hard to get this done but still did not find any solutions. I'm wondering if anyone can help with this problem. Below is my code and I will show you both codes for CF9 and CF11.

Code for chart in CF9:

<cfchart format="#ffPrint#" xaxistitle="#desc#" yaxistitle="#yTitle#" style="ChartStyle.xml"

  chartheight="700" chartwidth="#graphWidth#" title="#title#"  showlegend="#theLegend#" >

  

  <cfchartseries type="bar" itemcolumn="Spacer" valuecolumn="" seriescolor="white"  >

  <cfoutput>

  <cfloop list="#dataList#" index="i">

  <cfchartdata item="#i#" value="0">

  </cfloop>

  </cfoutput>

  </cfchartseries>

  <cfoutput query="getRecords" group="theYear">

  <cfchartseries type="bar" itemcolumn="#theYear#" valuecolumn="theCount" seriescolor="#listGetAt(theColors,colorIndex)#" >

  <cfset colorIndex++>

  <cfoutput>

  <cfchartdata item="#Description#" value="#theCount#">

  </cfoutput>

  </cfchartseries>

  </cfoutput>

  </cfchart>

Code for my chart in CF11:

<cfchart format="html" xaxistitle="#desc#" yaxistitle="#yTitle#" style="#cStyle#"

  chartheight="700" chartwidth="#graphWidth#" title="#newTitle2#"  showlegend="#theLegend#">

  <cfoutput query="getRecords" group="theYear">

  <cfchartseries type="bar" itemcolumn="#theYear#" valuecolumn="theCount" seriescolor="#listGetAt(theColors,colorIndex)#" serieslabel="#theYear#">

  <cfset colorIndex++>

  <cfoutput>

  <cfchartdata item="#Description#" value="#theCount#">

  </cfoutput>

  </cfchartseries>

  </cfoutput>

  </cfchart>

In order to get any records in CF11 I had to remove my first CFCHARTSERIES, still if I have combination of 2015 and 2016 years records my chart does not display values on the screen. I think that problem is in CFCHARTSERIES but I do not what should be changed to fix this issue. If anyone can help please let me know.

Thanks in advance!

Views

551

Likes

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

How to fix cfchartseries in coldfusion 11?

Community Beginner ,
Mar 10, 2016

Copy link to clipboard

Copied

Hello everyone, I'm trying to fix my cfchart in CF11 to look some similar like in previous CF9. I converted my .xml files and instead I use JSON to style my elements. Problem that I can not fix is cfchartseries. My data that i'm passing in my chartseries looks good, I tried to output everything on the screen before I tested my chart. In CF9 my Time records were displayed on the screen from the first value all the way up to the last value. Here is my screen shot of my chart in CF9:

CF9.png

As you can see on the picture above all my time slots are displayed on the screen in order from the lowest to the highest. Also my record for 2015 is displayed with the bar in blue color, 2016 in pink color. Now I will show you my chart with the exact same code in CF11:

CF11.png

You can see thatmy chart in CF11 starts with the blue bar that present year 2015 and time slot that should not be on the first spot 1415. Also my other time slots are not displayed on the screen. I have tried so hard to get this done but still did not find any solutions. I'm wondering if anyone can help with this problem. Below is my code and I will show you both codes for CF9 and CF11.

Code for chart in CF9:

<cfchart format="#ffPrint#" xaxistitle="#desc#" yaxistitle="#yTitle#" style="ChartStyle.xml"

  chartheight="700" chartwidth="#graphWidth#" title="#title#"  showlegend="#theLegend#" >

  

  <cfchartseries type="bar" itemcolumn="Spacer" valuecolumn="" seriescolor="white"  >

  <cfoutput>

  <cfloop list="#dataList#" index="i">

  <cfchartdata item="#i#" value="0">

  </cfloop>

  </cfoutput>

  </cfchartseries>

  <cfoutput query="getRecords" group="theYear">

  <cfchartseries type="bar" itemcolumn="#theYear#" valuecolumn="theCount" seriescolor="#listGetAt(theColors,colorIndex)#" >

  <cfset colorIndex++>

  <cfoutput>

  <cfchartdata item="#Description#" value="#theCount#">

  </cfoutput>

  </cfchartseries>

  </cfoutput>

  </cfchart>

Code for my chart in CF11:

<cfchart format="html" xaxistitle="#desc#" yaxistitle="#yTitle#" style="#cStyle#"

  chartheight="700" chartwidth="#graphWidth#" title="#newTitle2#"  showlegend="#theLegend#">

  <cfoutput query="getRecords" group="theYear">

  <cfchartseries type="bar" itemcolumn="#theYear#" valuecolumn="theCount" seriescolor="#listGetAt(theColors,colorIndex)#" serieslabel="#theYear#">

  <cfset colorIndex++>

  <cfoutput>

  <cfchartdata item="#Description#" value="#theCount#">

  </cfoutput>

  </cfchartseries>

  </cfoutput>

  </cfchart>

In order to get any records in CF11 I had to remove my first CFCHARTSERIES, still if I have combination of 2015 and 2016 years records my chart does not display values on the screen. I think that problem is in CFCHARTSERIES but I do not what should be changed to fix this issue. If anyone can help please let me know.

Thanks in advance!

Views

552

Likes

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
Mar 10, 2016 0

Have something to add?

Join the conversation