Appearance Files

The primary function of PopChart XML is to tell PopChart Server what a PopChart image should look like—in other words, how PopChart Server should translate data into a PopChart image.

You can create an appearance file either using PopChart Builder, or by building the PopChart XML yourself. Although the former method is highly recommended, you can create appearance files on the fly when you build them yourself.

You will probably have PopChart Server load your appearance file in one of three ways:

Important: In order for PopChart Server to load any kind of file or data source, it must be given permission to read data from the specified path or domain. See "Setting Path Permissions" in Chapter 3 for more information.

You should tell PopChart Server where to find the appearance file by setting either the appearanceFile PopChart Embedder attribute, or the @_FILE server command. For example, if you wanted to set the appearance file to examples/apfiles/pareto.pcxml, you would use the following line of code with the PopChart Embedder:

myPopChart.appearanceFile = "examples/apfiles/pareto.pcxml";

Note: This example, as well as all examples in this chapter, assume our PopChart Embedder object is named myPopChart.

Or, you would add the following to the server command string:

@_FILEexamples/apfiles/pareto.pcxml

As another example, suppose you are generating your appearance file dynamically by means of a web application at http://webapp.mycompany.com/apfiles?graph=bar1. Assuming your security permissions have been properly set, you could have PopChart Server load this appearance file with this PopChart Embedder command:

myPopChart.appearanceFile = "examples/apfiles/pareto.pcxml";

By declaring this file as the appearance file, you are telling PopChart Server to use the PopChart XML from that file as the basis for the PopChart image it generates. Any other piece of PopChart XML that you send to PopChart Server by other means will be applied to or will override the appearance file.