Testing the Appearance File with the Example Code

One of the many convenient features of PopChart Builder is that it will automatically generate code to embed a PopChart image for you. Simply load or create an appearance file, select File > Sample Code, and choose the type of example code that you want. A dialog with sample code that you can copy will pop up.

In this dialog, you have a variety of choices. you can generate example code for a variety of environments, including JSPs, ASPs, Servlets, JavaBeans, JavaScript, PHP pages, and just straight HTML. The dialog also allows you to specify important variables, such as PCScript and your server address.

In some cases, you can cut and paste this example code directly into a file on your web server and have it work immediately. Most of the time, though, you'll want to customize this code further before publishing your PopChart image.

Either way, the sample code can save you a lot of time. And, of course, it's a great learning tool.

To Test the Appearance File with the JavaScript PopChart Embedder

These steps will help you test your appearance file with the example code generated for the JavaScript PopChart Embedder.

1. Start PopChart Builder.

2. Create and save an appearance file (or load one).

3. Select File > Sample Code > Java.


4. Under the Show Code For option, select JavaScript.

5. Click on the Copy Code to ClipBoard button.

6. Open up a new file in a text or HTML editor and paste the example code into the file.

7. Save the file to your computer as a web page (e.g. popchart.html).

8. Start PopChart Server on your computer.

9. View the web page that you saved in step 7.

If all goes well, you should see a PopChart image when you view the web page.

If you don't see anything, make sure PopChart Server has been started, and that it is running at http://localhost:2001. If it is running on a different machine, change the PopChartServer URL value in the sample code dialog. Also be sure to upload the appearance file to the same location on that machine.

For more instructions on embedding PopChart images, refer to Chapter 4, "Embedding PopChart Images in a Web Page," in the PopChart Server User Guide