Skip to main content
Participating Frequently
December 15, 2010
Question

Chart Caching

  • December 15, 2010
  • 1 reply
  • 636 views

I just move my server from Windows 2003 to Windows 2008 64 Bit running IIS7.  I am runninf Coldfusion9.  On the new server, all the chart are disappearing from the cache (\ColdFusion9\charting\cache) after a few seconds.  This makes them un-printable for IE users.  In the administrator/Charting I have the following settings:

Cache type: Disk Cache

51

Maximum number of charting threads:4

:E:\QIS\ColdFusion9\charting\cache

These are the same as my previous Win2003 32 server.

The old server, did not ever delete any thing from the cache directory.

How do I get the files to stay in the Cache directory for a reasonable amount of time (5 minutes).  The number images in the directory while never gets above 4.

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    December 15, 2010

    I'm not sure how to extend the cache - or if it's possible, but you can always use the 'name' attribute of the cfchart tag along with the image manipulation tags/functions in CF to write your own image to disk (temp file, whatever...).

    Here's a quick example:

    http://pastebin.com/vTrEkhjY

    Participating Frequently
    December 15, 2010

    To build on my last example, if you're using a modern browser that supports it you can even do this:

    <cfoutput>
        <img src="data:image/jpg;base64,#toBase64(chartImg)#" />
    </cfoutput>

    Participating Frequently
    December 15, 2010

    Actually, you don't even need to use imageNew() if using base64()... this would work:

    <cfchart xaxistitle="Department" yaxistitle="Salary Average" format="jpg" name="myChart">
        <cfchartseries type="bar" query="DataTable" itemcolumn="Dept_Name" valuecolumn="avgSal"><cfchartdata item="Facilities" value="35000"></cfchartseries>
    </cfchart>

    <cfoutput>
        <img src="data:image/jpg;base64,#toBase64(myChart)#" />
    </cfoutput>