"Fossies" - the Fresh Open Source Software archive

Member "jpgraph-3.5.0b1/docs/chunkhtml/ch28.html" of archive jpgraph-3.5.0b1.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted source code. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.

Chapter 28. Applying the prepared theme

To understand how themes are used, it is easiest to look at the sample code. For example, the Aqua Theme can be applied using the following.

1
2
3
4
<?php
$theme_class = new AquaTheme();
$graph->SetTheme($theme_class);
?>

In line 1, an instance of AquaTheme class is created, and the graph theme is changed by passing the instance to SetTheme(). To use 'GreenTheme' instead of 'AquaTheme', use the following.

1
$theme_class = new GreenTheme;

All theme classes inherit the abstract 'Theme' class.

Figure 28.1. Aqua Theme (aqua_example.php)

Aqua Theme (aqua_example.php)


Figure 28.2. Green Theme (green_example.php)

Green Theme (green_example.php)


Figure 28.3. Ocean Theme (ocean_example.php)

Ocean Theme (ocean_example.php)


Figure 28.4. Pastel Theme (pastel_example.php)

Pastel Theme (pastel_example.php)


Figure 28.5. Softy Theme (softy_example.php)

Softy Theme (softy_example.php)


Figure 28.6. Vivid Theme (vivid_example.php)

Vivid Theme (vivid_example.php)


Figure 28.7. Orange Theme (orange_example.php)

Orange Theme (orange_example.php)


Figure 28.8. Rose Theme (rose_example.php)

Rose Theme (rose_example.php)


Figure 28.9. Universal Theme (universal_example.php)

Universal Theme (universal_example.php)