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

How to show decimal in PieChart Percentages?

New Here ,
Jul 17, 2007 Jul 17, 2007

Copy link to clipboard

Copied

Hi. I have 3 companies to show in a pie chart:

CompA: $350
CompB: $450
CompC: $371

Total: $1171

CompA has 29.9%
CompB has 38.4%
CompC has 31.7%

I want to show a pie chart with percentages such as 29.9% instead of 30%, or 31.7% instead of 32%.

Is there a way to achieve this detail using CF7 cfchart ???

I have spent quite a bit of time but could not find a solution... Please help!!!

TOPICS
Advanced techniques

Views

725

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
New Here ,
Jul 16, 2012 Jul 16, 2012

Copy link to clipboard

Copied

I'd like to know this too!

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 ,
Jul 21, 2012 Jul 21, 2012

Copy link to clipboard

Copied

LATEST

Multiply by 1000 and round up, to pick out the 3 significant digits. Then divide by 10 to get the percentage.

<cfset a=round(1000*350/1171)/10>

<cfset b=round(1000*450/1171)/10>

<cfset c=round(1000*371/1171)/10>

<cfchart> 

<cfchartseries type="Pie" >

<cfchartdata item="CompA" value="#a#">

<cfchartdata item="CompB" value="#b#">

<cfchartdata item="CompC" value="#c#">

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