31 lines
3.5 KiB
HTML
31 lines
3.5 KiB
HTML
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 29. Attention</title><link rel="stylesheet" type="text/css" href="manual.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.0"><link rel="home" href="index.html" title="JpGraph Manual"><link rel="up" href="pt07.html" title="Part VII. Theme Class"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 29. Attention</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center">Part VII. Theme Class</th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter" title="Chapter 29. Attention"><div class="titlepage"><div><div><h2 class="title"><a name="id2619303"></a>Chapter 29. Attention</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ch29.html#id2619634">29.1. The order of SetTheme() and changing settings</a></span></dt><dt><span class="sect1"><a href="ch29s02.html">29.2. Changing the display settings of line/bar graphs</a></span></dt></dl></div>
|
||
|
||
<p>When using themes, there are some things that require particular attention.</p>
|
||
<div class="sect1" title="The order of SetTheme() and changing settings"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2619634"></a>The order of SetTheme() and changing settings</h2></div></div></div>
|
||
|
||
<p>At first, $graph->SetTheme() should be used after creating the graph, just after $graph->SetScale(). The following code is an example.
|
||
</p>
|
||
<p>
|
||
</p><div class="hl-main"><table class="hl-table" width="100%"><tr><td class="hl-gutter" align="right" valign="top"><pre>1
|
||
2
|
||
3
|
||
4
|
||
</pre></td><td class="hl-main" valign="top"><pre><span class="hl-code">$graph = new Graph(750, 320, 'auto');
|
||
$graph->SetScale('textlin');
|
||
$theme_class = new AquaTheme;
|
||
$graph->SetTheme($theme_class);</span></pre></td></tr></table></div><p>
|
||
</p>
|
||
<p>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.
|
||
</p>
|
||
<p>
|
||
</p><div class="hl-main"><table class="hl-table" width="100%"><tr><td class="hl-gutter" align="right" valign="top"><pre>1
|
||
</pre></td><td class="hl-main" valign="top"><pre><span class="hl-code">$graph->SetFrame(true);</span></pre></td></tr></table></div><p>
|
||
</p>
|
||
<p>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.
|
||
</p>
|
||
</div>
|
||
|
||
</div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"><a accesskey="u" href="pt07.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
|