Contents Previous Next

8.16 Using a background gradient

In addition to the background image you can also add a background color gradient. This gradient can be covering the entire graph, just the plot area or just the margins. This flexibility allows you to combine a background image with a background color gradient. You can for example use a background image in the plot area and a color gradient out in the margins.

You specify a color gradient background by calling the Graph::SetBackgroundGradient() method. All details are available in the class reference (follow the link above). We finally give a quick example on what kind of effect you can achieve using this feature.

Figure 90: Using a background color gradient with the SetBackgroundGradient() method [src] 

Finally we like to mention that in the "/utils/misc/" directory you will find a small utility script called "mkgrad.php". Running this script presents you with a UI that makes it a breeze to create a gradient image on it's own.

The UI for the utility is so obvious that we won't discuss it further, we just show it below. The UI for the mkgrad.php utility The UI for the mkgrad.php utility

In the example below this utility is used to get a more interesting plot area.

Figure 91: Example of the use of a gradient background [src] 

Contents Previous Next