"Fossies" - the Fresh Open Source Software archive

Member "jpgraph-3.5.0b1/docs/chunkhtml/ch29.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 29. Attention

Table of Contents

29.1. The order of SetTheme() and changing settings
29.2. Changing the display settings of line/bar graphs

When using themes, there are some things that require particular attention.

The order of SetTheme() and changing settings

At first, $graph->SetTheme() should be used after creating the graph, just after $graph->SetScale(). The following code is an example.

1
2
3
4
$graph = new Graph(750, 320, 'auto');
$graph->SetScale('textlin');
$theme_class = new AquaTheme;
$graph->SetTheme($theme_class);

In this way, all the settings of AquaTheme(grid, background and font color etc) can be applied. Any plots after this will also use the AquaTheme settings. Of course there are times where we only want to change individual settings and not the overall theme. For example, there is no outline around the graph in 'AquaTheme'. To add an outline we can do the following. After SetTheme(), you can use functions to change individual settings. If you want to display an outline around the graph, add the following line to the code shown previously.

1
$graph->SetFrame(true);

In this way, all the settings of AquaTheme(grid, background and font color etc) can be applied. Any plots after this will also use the AquaTheme settings.