mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
git-svn-id: http://www.observium.org/svn/observer/trunk@358 61d68cd4-352d-0410-923a-c4978735b2b8
190 lines
13 KiB
HTML
190 lines
13 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_SUPERSCRIPTTEXT"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>SuperScriptText</b> EXTENDS <a href="Text .html#_C_TEXT " style="font-face:arial;font-weight:bold;">Text </a></div>
|
|
<i>(Defined in: jpgraph.php : 3155)</i><table border=1><tr><td> <a href="SuperScriptText.html" style="font-family:arial;font-weight:bold;color:darkblue;">SuperScriptText</a> </td><td> <a href="Text .html" style="font-family:arial;font-weight:bold;color:darkblue;">Text </a> </td></tr><tr><td valign=top> <a href="SuperScriptText.html#_SUPERSCRIPTTEXT_FROMREAL">FromReal()</a> <br>
|
|
<a href="SuperScriptText.html#_SUPERSCRIPTTEXT_GETFONTHEIGHT">GetFontHeight()</a> <br>
|
|
<a href="SuperScriptText.html#_SUPERSCRIPTTEXT_GETTEXTHEIGHT">GetTextHeight()</a> <br>
|
|
<a href="SuperScriptText.html#_SUPERSCRIPTTEXT_GETWIDTH">GetWidth()</a> <br>
|
|
<a href="SuperScriptText.html#_SUPERSCRIPTTEXT_SET">Set()</a> <br>
|
|
<a href="SuperScriptText.html#_SUPERSCRIPTTEXT_SETSUPERFONT">SetSuperFont()</a> <br>
|
|
<a href="SuperScriptText.html#_SUPERSCRIPTTEXT_SUPERSCRIPTTEXT">SuperScriptText()</a> <br>
|
|
</td><td valign=top> </td></tr></table> <p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>This class is responsible for formatting a text string which have a superscript at the end. This is used to generate scientific numbers.
|
|
<p>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="Text.html">Text</a> <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="_SUPERSCRIPTTEXT_FROMREAL"><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 FromReal($aVal,$aPrecision)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Create a scientific representation for a number </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">
|
|
$aVal</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Real value to be used</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aPrecision</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
2</font>
|
|
</td><td>Precision (number of digits) to be printed</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Initialized the class from a real value to be used to present a scientific text string.
|
|
<br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="SuperScriptText.html#_SUPERSCRIPTTEXT_SET">SuperScriptText::Set</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">
|
|
$t = new SuperScriptText();
|
|
<br />$t->FromReal(12341.56);
|
|
<br />
|
|
<br />// Will print 1.23*10^4
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_SUPERSCRIPTTEXT_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>Hight of font (approximate the height of 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">
|
|
&$aImg</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Image context</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Return height of text. <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="SuperScriptText.html#_SUPERSCRIPTTEXT_GETTEXTHEIGHT">SuperScriptText::GetTextHeight</a> and <a href="SuperScriptText.html#_SUPERSCRIPTTEXT_GETWIDTH">SuperScriptText::GetWidth</a><p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_SUPERSCRIPTTEXT_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>Hight 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>Image context</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Hight of text <br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_SUPERSCRIPTTEXT_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>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>Image context</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Total width of text <br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_SUPERSCRIPTTEXT_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,$aSuper)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Convert a floating point number to scientific notation</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>Mantissa</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aSuper</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
""</font>
|
|
</td><td>Exponent</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the string manuall by specifyin mantissa and exponent. <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="SuperScriptText.html#_SUPERSCRIPTTEXT_FROMREAL">SuperScriptText::FromReal</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">
|
|
$t = new SuperScriptText();
|
|
<br />$t->Set("1.34 10","5");
|
|
<br />// Will generate "1.34 10^5"
|
|
<br /></font>
|
|
</span><br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_SUPERSCRIPTTEXT_SETSUPERFONT"><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 SetSuperFont($aFontFam,$aFontStyle,$aFontSize)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Manually set font to be used for superscript</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">
|
|
$aFontFam</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">
|
|
$aFontStyle</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">
|
|
$aFontSize</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
8</font>
|
|
</td><td>Font size</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Used to manually specify font to be used for superscript. If not specified it will be detemined automatically based on the font used for the mantissa. The font for the superscript will be roughly 70% of the size of the base font. <br>
|
|
<p>
|
|
<p> <p> <span style='font-size:110%;'><a name="_SUPERSCRIPTTEXT_SUPERSCRIPTTEXT"><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 SuperScriptText($aTxt,$aSuper,$aXAbsPos,$aYAbsPos)</font>
|
|
</b></div></a></span>
|
|
|
|
<span style='font-family:arial;font-size:90%;'><i>Constructor</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>Mantissa text</td></tr>
|
|
|
|
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
$aSuper</font>
|
|
|
|
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
""</font>
|
|
</td><td>Suoerscript text</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-position (in pixels)</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 (in pixels)</td></tr>
|
|
</table>
|
|
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Creates a new SUperSCriptClass <br>
|
|
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_TEXT">Text::Text</a><p> <hr> <p> |