Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
CFkubio #1
chart decimals
Hi all,
I'm looking for an example or some help making a linear graph of decimal
pairs. I've tried to simplify it but still can't quite get everything to work
right in ColdFusion. Here is my sample data (X,Y):
(2.0,5.5) (8.0,2.5) (4.0,3.0) (1.1,4.0).
I'm getting "Error Occurred While Processing Request" For input string: "2.0".
Stack Trace...
java.lang.NumberFormatException: For input string: "2.0"
Can ColdFusion be used to create a linear plot/chart/graph when X and Y are
both decimal numbers? Any suggestions appreciated.
<cfchart xAxisType="scale">
<cfchartseries type="line">
<cfchartdata item=2.0 value=5.5>
<cfchartdata item=8.0 value=2.5>
<cfchartdata item=4.0 value=3.0>
<cfchartdata item=1.1 value=4.0>
</cfchartseries>
</cfchart>
CFkubio Guest
-
stacked Bar chart/Line chart hybrid- Charting
Hi all, I have a requirement to have a stacked bar graph, with a line graph on the same chart. Has anyone here done this before? Apparently there... -
Refreshing chart data doesnt update chart
I must be missing something simple here. I have a column chart that is using an array for its dataprovider. However, when I update the underlying... -
14 decimals after comma
For the benefit of the regulars, here's my plan: Each time a newcomer posts this question, I'll find the most recent example and move that thread... -
Error in DBD::Chart (called from DBIx::Chart)
I'm receiving this error message when I run a PERL script: Use of uninitialized value in string ne at C:/Perl/site/lib/DBD/Chart.pm line 2491. ... -
Decimals not Getting into ASP
We have an ASP page that grabs data from an Oracle 9i table and then dumps it into another. It had been working great until we swapped out servers.... -
-
CFkubio #3
Re: chart decimals
Thanks for your reply, BKBK, sorry I don't follow, what am I missing?
Is it the data type?
I know the documentation says if xAxisType = "scale" then "all cfchartdata
item attribute values must be numeric."
Is cfchartdata reading item=2.0 as a string of text?
Do I have to set the data type to numeric? If so, how?
CFkubio Guest
-
BKBK #4
Re: chart decimals
What happens when you do item="2.0" in place of item=2.0?
I always thought item must be a string, but can't remember whether
value may accept fractions. I'm going off to check. In any case, I would
do what most people do, which is in fact the accepted good preactice.
Scale the values by a factor, e.g. 10.
BKBK Guest
-
CFkubio #5
Re: chart decimals
I get the same thing with or without quotes. thanks for the suggestion, I take it "Scale the values by a f actor of 10 that you mean multiply the items (or x) by 10, right?
CFkubio Guest
-
BKBK #6
Re: chart decimals
>... you mean multiply the items (or x) by 10, right?
yes
I've checked that the chart specification does indeed accept>... I get the same thing with or without quotes
decimals. In MX7 anyway. But not with the attribute xAxisType="scale".
This should do you.
<cfchart>
<cfchartseries type="line">
<cfchartdata item="2.0" value=5.5>
<cfchartdata item="8.0" value=2.5>
<cfchartdata item="4.0" value=3.0>
<cfchartdata item="1.1" value=4.0>
</cfchartseries>
</cfchart>
BKBK Guest
-
CFkubio #7
Re: chart decimals
I got something working now, going back to your previous suggestion, I
multiplied the data by a factor of 100, then CAST AS int to remove the decimal
places from query data.
xAxisType has to be scale, otherwise the data is just string, (it can be
sorted alphabetically but the numbers won't appear in a linear scale).
CFkubio Guest



Reply With Quote

