Part II. Basic graph creation

The goal of this part is to introduce some basic concepts that must be known when creating graphs with the JpGraph library. It will also serve as a gentle introduction on how to structure a basic graph script.

The challenge of writing a good manual is that it is sometimes necessary to use concepts that might not have been fully explained in order to clarify some even more basic concept. So if there are parts that you do not fully understand do not despair. The remainder of the manual will explain a lot more of the details.

Table of Contents

4. Your first graph script
4.1. Some words of caution
4.2. Graphing the number of sun spots during the 19th Century
4.2.1. The historic data
4.2.2. Preparing the data
4.2.3. A basic line graph
4.2.4. A basic bar graph
5. Fundamentals of dynamic graph generation
5.1. Making sense of HTTP streams and MIME types
5.2. What is an image?
5.3. Static vs dynamic images
5.4. Dynamic images on the command line
5.5. How to generate images with JpGraph library
5.5.1. The standard steps of setting up a graph
5.5.2. Choosing the image compression format for JpGraph
5.5.3. Sending back the image to the browser
5.5.4. Writing the image directly to a file
5.5.5. Alternatives to streaming or storing the image
5.5.6. Forcing the browser to update your graph
5.5.7. Printing the generated image
5.6. Efficient graph generation using the built-in cache subsystem
6. Error handling
6.1. The problem with error messages and images
6.1.1. Catching errors in other parts of the system while creating images
6.2. Available error messages
6.2.1. Localizing error messages
6.2.2. Error messages on a production server
6.3. Using PHP Exceptions
6.3.1. Selecting between text and image based error handling
6.3.2. Writing error message to a log file (or system logger)
6.4. Adding a new locale
7. Color handling
7.1. Specifying colors by name
7.2. Specifying colors by RGB triples
7.3. Using HTML color specifications
7.4. Fine tuning the color
7.4.1. Specifying the alpha channel (color transparency)
7.4.2. Adjusting the brightness
7.4.3. Combining brightness and transparency adjustment
7.5. Additional color handling
8. Text and font handling
8.1. Different types of fonts
8.2. Font families and font styles
8.2.1. Default TrueType Font
8.3. Understanding text alignment and anchor point
8.4. Rotating text
8.5. Formatting text paragraphs
8.6. Adding custom TTF fonts
8.7. Inserting Unicode entities
8.7.1. The utility class "SymChar"
8.7.2. Graph example with Greek labels
8.8. Character encoding
8.8.1. Japanese encoding options
8.8.2. Chinese encoding options
8.8.3. Cyrillic encoding options
8.8.4. Hebrew encoding options
8.8.5. Greek encoding options
9. Using the JpGraph cache system
9.1. Enabling the library cache system
9.2. Permission settings for the cache files
9.3. Using the cache in your script
9.3.1. Manually controlling the cached image
9.4. Using the cache with Client Side Image Maps (CSIM)
10. Using CSIM (Client side image maps)
10.1. The principles
10.2. The basic structure of an image map script
10.3. Specifying targets for image map plots
10.3.1. Creating popup-windows as targets for CSIM
10.4. Using StrokeCSIM()
10.4.1. Optional argument to StrokeCSIM()
10.4.2. How does StrokeCSIM() work?
10.4.3. Image maps and the cache system
10.5. Getting hold of the image map
10.6. Mixing several CSIM images in an HTML page with text
10.6.1. Adding one CSIM graph in a HTML page
10.6.2. Adding multiple CSIM graphs in a HTML page
11. NuSphere PHP accelerator
11.1. Introduction and purpose
11.2. Installing PhpExpress