Got it. It was a cffile problem! Just had to add a charset attribute.
 
 
 
The cffile tag has changed to use a different default encoding when writing to a file. Therefore, to write a generated graph to a file using the name attribute of cfchart, you now have to add the following attribute to the cffile tag: charset="ISO-8859-1".
 
Thanks again for your help Tim.
 
Gavin
 
----- Original Message -----
Sent: Friday, September 26, 2003 12:18 PM
Subject: [cfaussie] Re: cfchart on linux

Hi Tim,
 
Well at least I know now that it's not just me!
 
#attributes.chart_format# is certainly png... it generates a valid png file when the name attribute is not passed to cfchart.
 
I suppose i could generate CF display the chart dynamically inside a cfsavecontent, and then search for the url of the resulting PNG by finding the IMG tag in the string and then use CFHTTP to get the chart. That's a pain tho.
 
Would lots of those cfhttps slow things down on the server?
 
I cant seem to find a technote or anything on macromedia about this. very strange.
 
Thanks for your help Tim.
 
Gav
 
----- Original Message -----
From: Tim Lucas
Sent: Friday, September 26, 2003 12:17 AM
Subject: [cfaussie] Re: cfchart on linux

Well I'm not sure what's in your #attributes.chart_format# but have you tried just:
format="png"

I tried this bit of code on MX and it works, on 6.1 it generates corrupt files

<cfchart
    format="png"
    chartheight="300"
    chartwidth="600"
    name="piechart">

    <cfchartseries
        type="pie">

        <cfchartdata item="Wicked Beat Sound System" value="328" />
        <cfchartdata item="Dj Shadow" value="321" />
        <cfchartdata item="Ltj Bukem" value="267" />
        <cfchartdata item="Outkast" value="175" />
        <cfchartdata item="Fatboy Slim" value="143" />
        <cfchartdata item="Deep Forest" value="136" />
        <cfchartdata item="Apollo Four Forty" value="129" />
        <cfchartdata item="Marco V" value="120" />
        <cfchartdata item="Transglobal Underground" value="119" />
        <cfchartdata item="Supreme Beings Of Leisure" value="114" />
        <cfchartdata item="Juno Reactor" value="112" />
        <cfchartdata item="Caf? Del Mar" value="109" />
        <cfchartdata item="Jurassic 5" value="107" />
        <cfchartdata item="Air" value="102" />
        <cfchartdata item="Dj Krush & Toshinori Kondo" value="96" />

    </cfchartseries>
</cfchart>

<cffile
    file="#ExpandPath('pie_chart_popular_artists.png')#"
    action=""
    nameconflict="overwrite"
    output="#piechart#" />

On my CFMX6 win32 this works fine and generates a valid PNG or JPG file.

On my CFMX6.1 win32 this generates a corrupt file for both PNG and JPG.

If you let CFMX display it dynamically it works fine for both MX and 6.1

The two files can be downloaded here:
http://www.toolmantim.com/pie_chart_popular_artists_6.png
http://www.toolmantim.com/pie_chart_popular_artists_61.png

Looking at the hexdump of the both files, MX is creating a valid PNG sig but 6.1 is not:
MX:  89 50 4e 47 0d 0a 1a 0a
6.1:   3f 50 4e 47 0d 0a 1a 0a

http://www.libpng.org/pub/png/spec/iso/#5PNG-file-signature

I assume the first byte is probably corrupt for the JPG as well.

Any ideas?

- tim

Gavin Cooney spoke the following wise words on 25/09/2003 3:21 PM EST:
Hi all
 
I'm generating charts and saving them to disk using CFCHART on MX (not 6.1 just yet!). This is on a Linux box.
 
This code works fine to display the chart, but when i add the  name="chart_var" bit (saves the generated chart to a variable), it appears to work fine, but the generated chart seems to be in an invalid format. It wont open in a browser, and when i try to open it in Photoshop it comes up with "could not open [file] because the file-format module cannot parse the file.".
 
<cfchart
 name="chart_var"
 format="#attributes.chart_format#"
 showlegend="no"
 pieslicestyle="solid"
 show3d="yes"
 chartheight="200"
 chartwidth="200">
<cfchartseries
 type="pie"
 query="online_answers"
 valueColumn="count_answer"
 itemColumn="answer_letter"
 colorList="##fbf709,##333333,##ff5700,##cfc9c7,##ff0000"
 paintstyle="shade">
</cfchart>
 

<cffile action="" output="#chart_var#" file="#application.online_chart_png_upload##saved_file_name#">
PNG file Written<br>
 
I'm sure this code worked before on this machine, and it works fine on my own PC.
 
Any ideas?
 
Gav
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to