Namespace: GlobFX.SwiffChartGenerator
Assembly: GlobFX.SwiffChartGenerator (in GlobFX.SwiffChartGenerator.dll)

Specifies the cache name if caching is used.

Visual Basic
Public Sub SetCacheName( cache_name As String )
C#
public void SetCacheName( string cache_name );

Arguments

cache_name
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:\Inetpub\wwwroot", calling SetCacheName("/swf_cache") will set the public cache directory to "C:\Inetpub\wwwroot\swf_cache".
Cached files will then be written in this directory and their URL will be "/swf_cache/XXXXXXXX-XXXXXXXX.swf".

Sample Code

The following code illustrates use of the SetCacheName method.

Visual Basic
' Create the chart series
chart.SetDataFromTxtFile("C:\\myData.txt")
chart.LoadStyle("C:\\myStyle.scs")

' Set a custom cache name
chart.SetCacheName("/my_cache_name")
C#
// Create the chart series
chart.SetDataFromTxtFile("C:\\myData.txt");
chart.LoadStyle("C:\\myStyle.scs");

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

See Also

SetPrivateCacheDir Method | SetMaxCacheSize Method | ClearCache Method | UseCache Method

Applies To: Chart Object