tracker issue : CF-4203382

select a category, or use search below
(searches all categories and all time range)
Title:

Pie charts created using CFCHART with any 0 data values produce wrong results

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): Bruce Holm / ()

Created: 10/22/2018

Components: Charting/Graphing

Versions: 2016,13.0

Failure Type: Others

Found In Build/Fixed In Build: ColdFusion 2016 Update 5 /

Priority/Frequency: Normal /

Locale/System: / Windows 10 64 bit

Vote Count: 1

Problem Description:
This is a problem that was first observed with CF8 using the cfchart tag. We have since upgraded to CF2016 and it still exists. Perhaps this is a programming error on our part but here is the issue:

Trying to create a pie chart. In this case I have 4 data items. Two of them have 0 values and the other two each have a value of 50 (representing percentages).

Steps to Reproduce:
This is in response to a title to this posing as a question... How do you feel today?

<cfsavecontent variable="chartContent">
  <cfchart format="png" pieslicestyle="solid" width="400" height="280">
    <cfchartseries type="pie">
      <cfchartdata item="Terrific!" value="0">
      <cfchartdata item="OK" value="50">
      <cfchartdata item="Not so good" value="50">
      <cfchartdata item="Terrible!" value="0"> 
    </cfchartseries>
  </cfchart>
</cfsavecontent>

I don't know if the cfsavecontent has any bearing on this but I left it in because we use it to place the chart on a template page.


Actual Result:
This is what I get for the results: (See Results1.png)

This is completely wrong!

The color mapping shows one color not two.
The color choice is wrong for either of the 50% values, suggesting 100% have a value of "Terrible!" 

We have observed this with other quantity of answer options.
We have seen it wrong with one of the 4 having a non-0 value but the rest are 0 values.


Expected Result:

Any Workarounds:
The only work around we have found is to always place non-0 values last in the list, all 0 values first.

So changing the data order around...

<cfsavecontent variable="chartContent">
  <cfchart format="png" pieslicestyle="solid" width="400" height="280">
    <cfchartseries type="pie">
      <cfchartdata item="Terrible!" value="0"> 
      <cfchartdata item="Terrific!" value="0">
      <cfchartdata item="OK" value="50">
      <cfchartdata item="Not so good" value="50">
    </cfchartseries>
  </cfchart>
</cfsavecontent>

Then you get this pie chart: (see result2.png)

At least the color mapping is correct but the answer options have to be rearranged so that all 0 value data items are at the top of the list. If it was the opposite where only items at the top of the list were colored it would be better but having to rearrange the order to put non-0 data as the last in the list of cfchartdata is a terrible hack! Having incorrect color mapping as in the desired implementation shown first above is just unusable!!

Attachments:

Comments:

See https://forums.adobe.com/message/10214656 for thread on this topic.
Comment by Bruce Holm
29813 | October 22, 2018 03:57:55 AM GMT
I have been able to reproduce the bug in ColdFusion 2018
Comment by A. Bakia
29814 | October 22, 2018 04:07:51 AM GMT