mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-14 08:03:35 +02:00
git-svn-id: http://www.observium.org/svn/observer/trunk@358 61d68cd4-352d-0410-923a-c4978735b2b8
777 lines
46 KiB
HTML
777 lines
46 KiB
HTML
<style type="text/css">
|
|
<!--
|
|
A:link {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
|
|
A:visited {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
|
|
A:hover {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: underline; color: #FF0000}
|
|
th {font-family: helvetica, arial; color : blue; font-size:85%; background : lightgrey; border-right:black solid 1pt; border-bottom:black solid 1pt;}
|
|
//-->
|
|
</style><hr><a name="_C_TEXT"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>Text</b></div>
|
|
<i>(Defined in: jpgraph.php : 2778)</i><table border=1><tr><td> <a href="Text.html" style="font-family:arial;font-weight:bold;color:darkblue;">Text</a> </td></tr><tr><td valign=top> <a href="Text.html#_TEXT_ALIGN">Align()</a> <br>
|
|
<a href="Text.html#_TEXT_CENTER">Center()</a> <br>
|
|
<a href="Text.html#_TEXT_GETFONTHEIGHT">GetFontHeight()</a> <br>
|
|
<a href="Text.html#_TEXT_GETTEXTHEIGHT">GetTextHeight()</a> <br>
|
|
<a href="Text.html#_TEXT_GETWIDTH">GetWidth()</a> <br>
|
|
<a href="Text.html#_TEXT_HIDE">Hide()</a> <br>
|
|
<a href="Text.html#_TEXT_PARAGRAPHALIGN">ParagraphAlign()</a> <br>
|
|
<a href="Text.html#_TEXT_POS">Pos()</a> <br>
|
|
<a href="Text.html#_TEXT_SET">Set()</a> <br>
|
|
<a href="Text.html#_TEXT_SETALIGN">SetAlign()</a> <br>
|
|
<a href="Text.html#_TEXT_SETANGLE">SetAngle()</a> <br>
|
|
<a href="Text.html#_TEXT_SETBOX">SetBox()</a> <br>
|
|
<a href="Text.html#_TEXT_SETCOLOR">SetColor()</a> <br>
|
|
<a href="Text.html#_TEXT_SETCSIMTARGET">SetCSIMTarget()</a> <br>
|
|
<a href="Text.html#_TEXT_SETFONT">SetFont()</a> <br>
|
|
<a href="Text.html#_TEXT_SETMARGIN">SetMargin()</a> <br>
|
|
<a href="Text.html#_TEXT_SETORIENTATION">SetOrientation()</a> <br>
|
|
<a href="Text.html#_TEXT_SETPARAGRAPHALIGN">SetParagraphAlign()</a> <br>
|
|
<a href="Text.html#_TEXT_SETPOS">SetPos()</a> <br>
|
|
<a href="Text.html#_TEXT_SETSCALEPOS">SetScalePos()</a> <br>
|
|
<a href="Text.html#_TEXT_SETSHADOW">SetShadow()</a> <br>
|
|
<a href="Text.html#_TEXT_SETWORDWRAP">SetWordWrap()</a> <br>
|
|
<a href="Text.html#_TEXT_SHOW">Show()</a> <br>
|
|
<a href="Text.html#_TEXT_TEXT">Text()</a> <br>
|
|
</td></tr></table> <p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>All text that is to be draw onto any graph is handled by this class. You create each text you want printed as an instance of this class.
|
|
|
|
It is possible to adjust both font, color, alignment and paragraph alignment.
|
|
|
|
If the text contains multiple lines (separated by "\n") the paragraph alignment determines how each line is formatted (i.e. left,center or right)
|
|
<p>
|
|
<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_ALIGN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function Align($aHAlign,$aVAlign,$aParagraphAlign)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Specify alignment for the text in relation to the x,y position for text</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aHAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Horizontal alignment</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aVAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
"top"</font>
|
|
</td><td>Vertical alignment</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aParagraphAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
""</font>
|
|
</td><td>Paragraph alignment</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>This determines how the text's x,y position is to be interpretated.
|
|
|
|
Valid horizontal alignments are
|
|
<ul>
|
|
<li> 'left'
|
|
<li> 'center'
|
|
<li> 'right'
|
|
</ul>
|
|
|
|
Valid vertical position are
|
|
<ul>
|
|
<li> 'top'
|
|
<li> 'middle' or 'center'
|
|
<li> 'bottom'
|
|
</ul>
|
|
|
|
Valid paragraph alignment
|
|
<ul>
|
|
<li> 'left'
|
|
<li> 'center'
|
|
<li> 'right'
|
|
</ul>
|
|
<br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_PARAGRAPHALIGN">Text::ParagraphAlign</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$text = new Text();
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_CENTER"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function Center($aLeft,$aRight,$aYAbsPos)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Center the text between left and right coordinates</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aLeft</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Left corner X-coordinate</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aRight</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Right corner X-coordinate</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aYAbsPos</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
false</font>
|
|
</td><td>The common Y-coodinate</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Center the text between left and right coordinates on the same Y-coordinate <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_POS">Text::Pos</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->Center(50,150,75);</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_GETFONTHEIGHT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function GetFontHeight(&$aImg)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Height of font</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
&$aImg</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>No description available</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Return the height of the font used in the text.
|
|
|
|
The difference between this method and the GetTextHeight() is that this method uses a predefined character to determine the height while GetTextHeight() uses the actual text in the string.
|
|
<br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_GETTEXTHEIGHT">Text::GetTextHeight</a> and <a href="Text.html#_TEXT_GETWIDTH">Text::GetWidth</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$height = $txt->GetFontHeight($graph->img)</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_GETTEXTHEIGHT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function GetTextHeight(&$aImg)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Return the height of the actual text in the text object</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
&$aImg</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>No description available</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Return the height of the text in this object.
|
|
|
|
The difference between this method and the GetFontHeight() is that that method uses a predefined character to determine the height while GetTextHeight() uses the actual text in the string. <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_GETFONTHEIGHT">Text::GetFontHeight</a> and <a href="Text.html#_TEXT_GETWIDTH">Text::GetWidth</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$height = $txt->GetTextHeight($graph->img);
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_GETWIDTH"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function GetWidth(&$aImg)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Get total width of text</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
&$aImg</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>No description available</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Get total width of text <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_GETTEXTHEIGHT">Text::GetTextHeight</a> and <a href="Text.html#_TEXT_GETFONTHEIGHT">Text::GetFontHeight</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$width = $txt->GetWidth($graph->img);
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_HIDE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function Hide($aHide)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Hide the text</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aHide</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
true</font>
|
|
</td><td>True=Hide text</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>The opposite of Show() <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_SHOW">Text::Show</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->Hide();</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_PARAGRAPHALIGN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function ParagraphAlign($aAlign)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Specifies the alignment for a multi line text</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Alignment for a multiline text</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the paragraph alignment for a multi line text. Each text line is separated by a "\n" character.
|
|
|
|
Valid alignments are:
|
|
<ul>
|
|
<li> 'left'
|
|
<li> 'center'
|
|
<li> 'right'
|
|
</ul> <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_ALIGN">Text::Align</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->Set("The first line\nSec line\nThird line");
|
|
<br />$txt->ParagraphAlign('center');
|
|
<br />
|
|
<br />// Will give the result:
|
|
<br />//
|
|
<br />// The first line
|
|
<br />// Sec line
|
|
<br />// Third line
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_POS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function Pos($aXAbsPos,$aYAbsPos,$aHAlign,$aVAlign)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Specify the position and alignment for the text object</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aXAbsPos</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
0</font>
|
|
</td><td>X-position absolute position</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aYAbsPos</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
0</font>
|
|
</td><td>Y-position absolute position</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aHAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
"left"</font>
|
|
</td><td>Horizontal alignment</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aVAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
"top"</font>
|
|
</td><td>Vertical alignment</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set the position text to be displayed. As a convinience the horizontal alignment may also be set in this call.
|
|
|
|
If you need to specify vertical position you have to use the Align() method. <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_ALIGN">Text::Align</a>, <a href="Text.html#_TEXT_SET">Text::Set</a> and <a href="Text.html#_TEXT_PARAGRAPHALIGN">Text::ParagraphAlign</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->Pos(100,150,'center');
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SET"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function Set($aTxt)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Set text to be displayed</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aTxt</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Text string</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set text to be displayed <br>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->Set('Hello world');</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETALIGN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetAlign($aHAlign,$aVAlign,$aParagraphAlign)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Alias for Align()</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aHAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Horizontal anchor point</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aVAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
"top"</font>
|
|
</td><td>Vertical anchor point</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aParagraphAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
""</font>
|
|
</td><td>Paragraph alignment</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>See Align <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_ALIGN">Text::Align</a><p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETANGLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetAngle($aAngle)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Specify text angle</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aAngle</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Angle in degrees</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify Orientation of text. If TTF fonts are used then the orientation can be a arbitrary angle. If the builtin fonts are used then only horizontal and vertical position can be used, i.e 0 or 90 degrees, <br>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->SetAngle(45);</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETBOX"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetBox($aFrameColor,$aBorderColor,$aShadowColor,$aCornerRadius,$aShadowWidth)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Set parameters for poossible frame around text</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aFrameColor</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
array(255,255,255)</font>
|
|
</td><td>Color for text background</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aBorderColor</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
array(0,0,0)</font>
|
|
</td><td>Color for border around text</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aShadowColor</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
false</font>
|
|
</td><td>Color for shadow</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aCornerRadius</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
4</font>
|
|
</td><td>Corner radius for rectangle</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aShadowWidth</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
3</font>
|
|
</td><td>Drop shadow width</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify parameters for background color, border and possible text drop shadow.
|
|
<br>
|
|
If no shadow color is specified then no shadow will appear.
|
|
<p>
|
|
To use the old style of stright corners specify a corner radius of 0.
|
|
|
|
<br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_SETSHADOW">Text::SetShadow</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt = new Text("Note: Simple textnote.\nWIth two lines");
|
|
<br />$txt->SetFont(FF_FONT1,FS_BOLD);
|
|
<br />$txt->Pos(0.5,0.97,'center','bottom');
|
|
<br />$txt->SetBox('yellow','black');
|
|
<br />$graph->AddText($txt);
|
|
<br />
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETCOLOR"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetColor($aColor)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Set text color</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aColor</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Color</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify color for text <br>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->SetColor('darkblue');</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETCSIMTARGET"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetCSIMTarget($aTarget,$aAlt)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Specify CSIM Target for text</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aTarget</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Target URL</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aAlt</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
null</font>
|
|
</td><td>Alt-tag text</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify Client Side Image Target for text <br>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$graph->title->SetCSIMTarget('mainpage.html','Go to main page');
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETFONT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetFont($aFamily,$aStyle,$aSize)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Specify font</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aFamily</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Font family</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aStyle</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
FS_NORMAL</font>
|
|
</td><td>Font style</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aSize</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
10</font>
|
|
</td><td>Font size</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify font family, size and style. Two major types of font families can be used, builtin bitmnapped fonts or TTF fonts. The builtin fonts have a fixed size which can't be altered.
|
|
|
|
Valid styles are
|
|
<ul>
|
|
<li> FS_NORMAL
|
|
<li> FS_BOLD
|
|
<li> FS_ITALIC
|
|
<li> FS_BOLDITALIC
|
|
</ul>
|
|
|
|
Valid values for the internal font families are
|
|
<ul>
|
|
<li> FF_FONT0, Internal font 1 (small font)
|
|
<li> FF_FONT1, Internal font 2, (Medium size)
|
|
<li> FF_FONT2, Internal font 3, (large size)
|
|
</ul>
|
|
|
|
Note: FF_FONT0 only suppor font style FS_NORMAL
|
|
|
|
The available TTF are by default
|
|
<ul>
|
|
<li> FF_ARIAL
|
|
<li> FF_TIMES, (Times Roman)
|
|
<li> FF_COURIER, (Courier new)
|
|
<li> FF_VERDANA, (Verdana)
|
|
<li> FF_BOOK, (Bookman)
|
|
<li> FF_HANDWRT, (Handwriting)
|
|
<li> FF_COMIC, (Sans Comic)
|
|
</ul>
|
|
<br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Image.html#_IMAGE_STROKETEXT">Image::StrokeText</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->SetFont(FF_ARIAL, FS_BOLD, 14);</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETMARGIN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetMargin($aMarg)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Set the contect sensiive margin</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aMarg</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Margin in pixels</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify a context sensitive margin for the text. Depending on in which context the text is used the margin will be interpretated accordingly. <br>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
// Start further away from the top of graph
|
|
<br />$graph->title->SetMargin(15);</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETORIENTATION"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetOrientation($aDirection)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Deprecated. Use SetAngle instead. Specify text angle </i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aDirection</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
0</font>
|
|
</td><td>Orientation of text in degrees</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Deprecated. Use SetAngle() instead.
|
|
Specify Orientation of text. If TTF fonts are used then the orientation can be a arbitrary angle. If the builtin fonts are used then only horizontal and vertical position can be used, i.e 0 or 90 degrees, <br>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->SetOrientation(90); // Vertical text</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETPARAGRAPHALIGN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetParagraphAlign($aAlign)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Specifies the alignment for a multi line text</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Horizontal alignment</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Determines how a multi-line text paragraph will be formatted. Each line in the paragraph will be treated individually. Allowed values are
|
|
<ol>
|
|
<li> "center"
|
|
<li> "left"
|
|
<li> "right"
|
|
</ol>
|
|
|
|
Note: Paragraph alignment is only applicable to horizontal text, i.e. angle = 0 . For paragraphs at an angle the alignbment will always be "left".
|
|
<br>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$graph->title->Set("Multi line\ntext !");
|
|
<br />$graph->title->SetParagraphAlign('right');
|
|
<br />
|
|
<br />// Default for title is "center"
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETPOS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetPos($aXAbsPos,$aYAbsPos,$aHAlign,$aVAlign)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Alias for Pos()</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aXAbsPos</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
0</font>
|
|
</td><td>X position</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aYAbsPos</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
0</font>
|
|
</td><td>Y position</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aHAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
"left"</font>
|
|
</td><td>Horizontal align</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aVAlign</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
"top"</font>
|
|
</td><td>Vertical align</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Alias for Pos() <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_POS">Text::Pos</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->Pos(100,150,'center');</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETSCALEPOS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetScalePos($aX,$aY)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Specify the position of the text using the plot scale positions</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aX</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>X-position</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aY</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Y-position</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the position of the text using the plot scale positions. The Y position is taken to be the Y axis. It is not possible to use Y2 scale to specify the position. <br>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt = new Text();
|
|
<br />$txt->SetScalePos(27.3, 278.9);</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETSHADOW"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetShadow($aShadowColor,$aShadowWidth)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Add a drop shadow to boxed text</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aShadowColor</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
'darkgray'</font>
|
|
</td><td>Shadow color</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aShadowWidth</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
3</font>
|
|
</td><td>Shadow width (in pixels)</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>If the text has been boxed (by call to SetBox()) then you can easily add a drop shadow by just calling this method.
|
|
<p>
|
|
Note: You can also specify the shadow directly in the SetBox() call. This method was added to make Text more like other graph objects which have a SetShadow() method. <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_SETBOX">Text::SetBox</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt = new Text("Note: Simple textnote.\nWIth two lines");
|
|
<br />$txt->SetFont(FF_FONT1,FS_BOLD);
|
|
<br />$txt->Pos(0.5,0.97,'center','bottom');
|
|
<br />$txt->SetBox('yellow','black');
|
|
<br />$txt->SetShadow();
|
|
<br />$graph->AddText($txt);
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SETWORDWRAP"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function SetWordWrap($aCol)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Specify a maximum line length</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aCol</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Number of chars in column</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify a maximum line length. This method will insert suitable line breaks to ensure thateach line never exeeds the specified number of characters. The method will not break words. <br>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt = new Text('A suitable long text which will be broken');
|
|
<br />$txt->SetWordWrap(15);</font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_SHOW"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function Show($aShow)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Show or hide the text string</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aShow</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
true</font>
|
|
</td><td>True=Display text</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Show or hide the text string. By default the text string is turned off. So a call to Show() is becessary for the text string to be displayed in the graph.
|
|
<br>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
$txt->Show();
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_TEXT_TEXT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
function Text($aTxt,$aXAbsPos,$aYAbsPos)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Constructor. Create new text at absolute pixel coordinates</i></span><p>
|
|
|
|
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aTxt</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
''</font>
|
|
</td><td>Text string</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aXAbsPos</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
0</font>
|
|
</td><td>X-coordinate</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aYAbsPos</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
0</font>
|
|
</td><td>Y-coordinate</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Create a new object to repesent a text string that is to be displayed on the graph.
|
|
|
|
If the position is not specified when the object is created it can later be specified with a call to the Pos() method.
|
|
|
|
The default alignment is to interpret the x,y coordinate as being the lower left corner of the bounding box for the text string.
|
|
|
|
Note. The texts are hidden by default and you must remember toi call Show() to make the text appear in the image. <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_POS">Text::Pos</a>, <a href="Text.html#_TEXT_SET">Text::Set</a>, <a href="Text.html#_TEXT_PARAGRAPHALIGN">Text::ParagraphAlign</a> and <a href="Text.html#_TEXT_SHOW">Text::Show</a>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
|
|
// Possible creations of text objects
|
|
<br />
|
|
<br />// Case 1. Text and position is specified later
|
|
<br />$txt = new Text();
|
|
<br />
|
|
<br />// Case 2. Position is specified later
|
|
<br />$txt = new Text('Hello world');
|
|
<br />
|
|
<br />// Case 3. Full specification
|
|
<br />$txt = new Text('Hello world',100,150);
|
|
<br />
|
|
<br />// A more real life example
|
|
<br />$txt = new Text("Note: Simple textnote.\nWIth two lines");
|
|
<br />$txt->SetFont(FF_FONT1,FS_BOLD);
|
|
<br />$txt->Pos(0.5,0.97,'center','bottom');
|
|
<br />$txt->SetBox('yellow','black');
|
|
<br />$graph->AddText($txt);
|
|
<br />
|
|
<br />
|
|
<br />
|
|
<br /></font>
|
|
</span><br>
|
|
<p> <hr> <p> |