<cfchart.. how do I set currency to pounds?

Hi,

Can anyone tell me how I set the laberlformat of a cfchart to a pound sign, rather than dollar sign.

In the .cfc that the chart is in, I am setting the locale to "English(UK)", which is setting all other local specifics to pounds [DollarFormat()..etc], but the labels in the chart are still showing a dollar sign.

I would have though that cfchart would have picked up on the Locale, but seemingly not.  Also, I can't find anywhere in the CF documentation or online that mentions how to force it.

Many thanks in advance.
<cfset setCurrentLocal = SetLocale("English (UK)")>
 
 
<cfchart chartwidth="390" chartheight="250" showlegend="false"  format="png" labelformat="currency" title="Comparative costs.">
                
                           <cfchartseries type="Bar" serieslabel="Total Costs" seriescolor="0163a7">
                                <cfchartdata item="Current estimated cost" value="#currentTotalEstimatedCost#">       
                                <cfchartdata item="Estimated cost if 90% registrations online" value="#currentProfitIncrease#">       
                                <cfchartdata item="Estimated revised cost" value="#ProfitIncrease#">   
                           </cfchartseries>
 
                        </cfchart>

Open in new window

Jay1607Asked:
Who is Participating?
 
MauseConnect With a Mentor Commented:
I added a file called mystyle.xml. Put this in the same directory as your cfm file and add style="mystyle.xml" to your cfchart tag. In this file I set the labelFormat/pattern and local.

You can (if you want) make more changes to the style than the default style attributes cfchart give you.

There is a file called "webcharts.bat" in you "\WEB-INF\cfusion\charting" directory. If you run this it will open a charting program webcharts3D that CF uses.
<cfchart style="mystyle.xml" chartwidth="390" chartheight="250" showlegend="false"  format="png" labelformat="currency" title="Comparative costs.">
    <cfchartseries type="Bar" serieslabel="Total Costs" seriescolor="0163a7">
         <cfchartdata item="Current estimated cost" value="#currentTotalEstimatedCost#">       
         <cfchartdata item="Estimated cost if 90% registrations online" value="#currentProfitIncrease#">       
         <cfchartdata item="Estimated revised cost" value="#ProfitIncrease#">   
    </cfchartseries>
 </cfchart>

Open in new window

0
 
MauseCommented:
Try this:

<cfset locale = CreateObject("java", "java.util.Locale")>
<cfset locale = locale.init("en", "UK")>
<cfset locale.setDefault(locale)>

instead of <cfset setCurrentLocal = SetLocale("English (UK)")>
0
 
Jay1607Author Commented:
Hi Mause, thanks for your reply.

I tried your suggestion.  It did set the locale and convert currency to pounds for CFML (e.g. DollarFormat()), however in the cfgraph, I am getting a strange char instead.

Good thing is that the format is being accessed at least (not just getting the $), but not giving us the pound sign.

Please see screen dump attached.

Any ideas?

Many Thanks.

Jason
cfgraphCurrency.gif
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
SidFishesCommented:
maybe try using dollarformat  in your chartdata item value?

if that doesn't work try using LSEuroCurrencyFormat

0
 
MauseCommented:
hhmmm file is missing

This is what is in the mystyle.xml file


<?xml version="1.0" encoding="UTF-8"?>
<frameChart is3D="false" isTransposed="false" seriesTitle="" decoration="None" font="Arial-11" foreground="black" isMultiline="false">
	<yAxis type="Scale" isVisible="true" isAbsolute="true" scaleMin="0" scaleMax="450" >
		<labelFormat style="Currency" pattern="#,##0.00" timezone="">
			<locale lang="en" country="GB" variant=""/>
		</labelFormat>
	</yAxis>
</frameChart>

Open in new window

0
 
Jay1607Author Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.