Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Chart Caching

New Here ,
Dec 15, 2010 Dec 15, 2010

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.

541
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 15, 2010 Dec 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 15, 2010 Dec 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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 15, 2010 Dec 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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 21, 2010 Dec 21, 2010
LATEST

Thank you for the help.  Unfortunately, this does not solve my problem for two reasons.

1)  I would have to change every script on my site that produces a chart.

2)  using this method, the image map that is created when the url Attribute no longer creates an image map.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources