ChartDirector 7.0 (Java Edition)

Path Specification


Many ChartDirector APIs expect a path for loading a file. Examples include BaseChart.setBgImage and the CDML <*img*> tag.

By default, ChartDirector assumes the path to be a file system path. If a relative path is used, it will be relative to the "current working directory" determined by the operating system. This may not be the same as the directory that contains the executing code. In addition, ChartDirector will also try to search for the file by interpreting the path as a Java resource path usable by the Java ClassLoader. This allows files to be stored in JAR files.

You may use BaseChart.setSearchPath and BaseChart.setSearchPath2 to specify additional file system directories and Java resource locations to search for the file.

For web applications, BaseChart.setSearchPath3 can be used to search relative to the servlet context. For applets, BaseChart.setSearchPath4 can be used to search based on the "code base" or "document base" of the applet.