Specifies the cache name if caching is used.

void object.SetCacheName( String cache_name )

Arguments

object
Required. A Chart object.
cache_name
Required. A string that specifies the cache name.

Remarks

If not defined in the Swiff Chart Generator Control Panel, the default cache name is "/charts_cache".

The cache name defines the location of the public cache on the web server.
The public cache directory stores the SWF, JPG, PNG, SVG and PDF files generated and returned by Swiff Chart Generator. This directory is defined as follows: <web_server_root>/<cache_name>.

This method overrides the Cache Name parameter value in the Swiff Chart Generator Control Panel as well as in the swfchart.ini configuration file


Important: for security reasons, web users should not be allowed to list this directory (otherwise they would be able to display any chart created on your server). You should therefore disable directory listing or put a default index file in it.

Example

If the web server root is "C:\Program Files\Apache Group\Apache\htdocs", calling SetCacheName("/swf_cache") will set the public cache directory to "C:\Program Files\Apache Group\Apache\htdocs\swf_cache".
Cached files will then be written in this directory and their URL will be "/swf_cache/XXXXXXXX-XXXXXXXX.swf".

JSP Sample Code

The following JSP code illustrates use of the SetCacheName method.

// Create the chart series
chart.SetDataFromTxtFile("C:\\myData.txt");
chart.LoadStyle("C:\\myStyle.scs");

// Set a custom cache name
chart.SetCacheName("/my_cache_name");

// The chart is complete, we can now generate the movie
out.println( chart.GetHTMLTag() );

See Also

SetPrivateCacheDir Method | SetMaxCacheSize Method | ClearCache Method | UseCache Method

Applies To: Chart Object