This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
phptsmadmin/includes/jpgraph/docs/chunkhtml/ch14s03.html
2011-05-28 19:51:52 +10:00

79 lines
7.9 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Adjusting the look and feel of the plot area</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="ch14.html" title="Chapter 14. Common features for all Cartesian (x,y) graph types"></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">Adjusting the look and feel of the plot area</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center">Chapter 14. Common features for all Cartesian (x,y) graph types</th><td width="20%" align="right"> </td></tr></table><hr></div><div class="sect1" title="Adjusting the look and feel of the plot area"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2543420"></a>Adjusting the look and feel of the plot area</h2></div></div></div>
<p>The graph area can be divided in two parts.</p>
<p>
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<p>The margin area</p>
</li><li class="listitem">
<p>The plot area</p>
</li></ol></div><p>
</p>
<p>These areas can have individual background colors as well as edges of user
settable size and color. In addition it is possible to use an image as background
with different formatting options.</p>
<div class="sect2" title="Plot area and margin areas"><div class="titlepage"><div><div><h3 class="title"><a name="id2543490"></a>Plot area and margin areas</h3></div></div></div>
<p>The plot area is where the plot is drawn and the margin area is everything
outside. Methods that affect the format of the plot area are</p>
<p>
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<p><code class="code">Graph::SetMargin() </code>, This will adjust the size (and
position) of the plot area</p>
</li><li class="listitem">
<p><code class="code">Graph::SetBox($aDrawPlotFrame=true,$aPlotFrameColor=array(0,0,0),$aPlotFrameWeight=1)</code>,
This will adjust tyhe format of the edge around the plot area. By
default this is disabled.</p>
</li></ol></div><p>
</p>
<p>In a similar way the margin areas peroperties can be adjusted with the
methods</p>
<p>
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<p><code class="code">Graph::SetMargin()</code> , same as above </p>
</li><li class="listitem">
<p><code class="code">Graph::SetMarginColor($aColor)</code></p>
</li><li class="listitem">
<p><code class="code">Graph::SetFram($aDrawImgFrame=true,$aImgFrameColor=array(0,0,0),$aImgFrameWeight=1)</code></p>
</li><li class="listitem">
<p><code class="code">Graph::SetFrameBevel($aDepth=3,$aBorder=false,$aBorderColor='black',$aColor1='white@0.4',$aColor2='darkgray@0.4',$aFlg=true)</code></p>
</li></ol></div><p>
</p>
</div>
<div class="sect2" title="Clipping to the plot area"><div class="titlepage"><div><div><h3 class="title"><a name="id2543579"></a>Clipping to the plot area</h3></div></div></div>
<p>When auto scaling is used no data points will ever be outside the plot area
since the scaling will make sure it covers the dynamic range of the data.
However, when setting the scale manually there is always the risk that some data
points are outside the specified scale. This could then lead to the result shown
in <a class="xref" href="ch14s03.html#fig.clipping_ex1" title="Figure 14.13. Original plot without clipping (clipping_ex1.php)">Figure 14.13. Original plot without clipping <code class="uri"><a class="uri" href="example_src/clipping_ex1.html" target="_top">(<code class="filename">clipping_ex1.php</code>)</a></code> </a> To avoid this situation it is possible
to enable clipping to the plot region by calling the method</p>
<p>
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
<p><code class="code">Graph::SetClipping($aFlg)</code></p>
</li></ul></div><p>
</p>
<p>This will "cut away" all parts of the plot that would otherwise be stroked
outside the plot area.<a class="xref" href="ch14s03.html#fig.clipping_ex2" title="Figure 14.14. Plot with clipping enabled (clipping_ex2.php)">Figure 14.14. Plot with clipping enabled <code class="uri"><a class="uri" href="example_src/clipping_ex2.html" target="_top">(<code class="filename">clipping_ex2.php</code>)</a></code> </a> shows the result
after clipping has been enabled.</p>
<p>
</p><div class="informaltable">
<table border="0"><colgroup><col class="c1"><col class="c2"></colgroup><tbody><tr><td>
<p>
</p><div class="figure"><a name="fig.clipping_ex1"></a><p class="title"><b>Figure 14.13. Original plot without clipping <code class="uri"><a class="uri" href="example_src/clipping_ex1.html" target="_top">(<code class="filename">clipping_ex1.php</code>)</a></code> </b></p><div class="figure-contents"> <span class="inlinemediaobject"><img src="images/clipping_ex1.png" alt="Original plot without clipping (clipping_ex1.php)"></span> </div></div><p><br class="figure-break">
</p>
</td><td>
<p>
</p><div class="figure"><a name="fig.clipping_ex2"></a><p class="title"><b>Figure 14.14. Plot with clipping enabled <code class="uri"><a class="uri" href="example_src/clipping_ex2.html" target="_top">(<code class="filename">clipping_ex2.php</code>)</a></code> </b></p><div class="figure-contents"> <span class="inlinemediaobject"><img src="images/clipping_ex2.png" alt="Plot with clipping enabled (clipping_ex2.php)"></span> </div></div><p><br class="figure-break">
</p>
</td></tr></tbody></table>
</div><p>
</p>
<p>
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>
<p>By default clipping is disabled since it will slightly increase the
CPU load and the time to generate the graphs.</p>
</div><p>
</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="ch14.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>