?
Solved

an issue with <cfchart value

Posted on 2014-12-30
5
Medium Priority
?
117 Views
Last Modified: 2015-01-12
Hi,

I am getting an error that says this:

Attribute validation error for CFCHARTDATA. The value of the VALUE attribute is invalid. The value cannot be converted to a numeric because it is not a simple value.Simple values are booleans, numbers, strings, and date-time values. 
The error occurred on line 201.

Open in new window





     <cfchart
         format="html"
       query="GetAppType"
showlegend="true"

         pieslicestyle="solid"
         chartheight="800" chartwidth="950" >
	<cfchartseries
	             type="pie"
	             serieslabel="Applications Type"
	             seriescolor="blue">
                 
                 <CFIF isDefined("GetAppType") and #GetAppType.RecordCount# gt 0>
                <cfloop query="GetAppType">
                       <cfchartdata item="#GetAppType.ApplicationType#" 
                        value="#GetAppType.Percentage#">        
              	</cfloop>
                                
           	</CFIF>

	</cfchartseries>
</cfchart>

Open in new window



The problem is with my  value="#GetAppType.Percentage#">        
the output of this

#GetAppType.Percentage#      

output is

0.13%
2.83%
40.89%

If I take the percent sign out, then it will work but I want the percent sign in the value.

Thank you for your help
0
Comment
Question by:lulu50
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 2000 total points
ID: 40524331
You can wrap val() around the value to use only  the numeric part of it.

As far as showing the % on the chart, you need to choose a chart style that is expecting a percent (that is, the percent is part of the chart format, not part of the value passed).

<cfchartdata item="#GetAppType.ApplicationType#"
                        value="#val(GetAppType.Percentage)#">
0
 

Author Comment

by:lulu50
ID: 40524456
gdemaria,

I'm not getting the error anymore after adding the val() but for some reason I cannot see the % sign

can I do something like this

#val(GetAppType.Percentage)# + '%'">
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 40524527
No unfortunately, that won't work.   The item tag is expecting a number.  

To get the percent sign to appear it is part of one of the parameters or the style.

I'm so sorry,  the family is waiting for me in the car, we are heading out of state for a couple days.  Sorry to leave you hanging, I don't recall which parameter it is, but it is some type of format or style that you have to apply, it is not in the number.  
Sorry !
0
 

Author Comment

by:lulu50
ID: 40524694
have fun!!!

I'll wait for you because most likely I wont know how to fix it.
0
 

Author Closing Comment

by:lulu50
ID: 40545073
Thank you
0

Featured Post

Python: Series & Data Frames With Pandas

Learn the basics of Python’s pandas library of series & data frames and how we can use these tools for data manipulation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question