Class SuperScriptText Extends Text
(Defined in: jpgraph.php : 3116)

SuperScriptText | Text

FromReal()
GetFontHeight()
GetTextHeight()
GetWidth()
Set()
SetSuperFont()
__construct()

Align()
Center()
GetFontHeight()
GetTextHeight()
GetWidth()
Hide()
ParagraphAlign()
Set()
SetAlign()
SetAngle()
SetBox()
SetColor()
SetCSIMTarget()
SetFont()
SetMargin()
SetOrientation()
SetParagraphAlign()
SetPos()
SetScalePos()
SetShadow()
SetWordWrap()
Show()
__construct()

Class usage and Overview
This class is responsible for formatting a text string which have a superscript at the end. This is used to generate scientific numbers.

See also related classes:
Text

Class Methods

SuperScriptText ::
FromReal($aVal, $aPrecision)
Create a scientific representation for a number

Argument | Default | Description
--- | --- | ---
$aVal |  | Real value to be used
$aPrecision | 2 | Precision (number of digits) to be printed

Description:
Initialized the class from a real value to be used to present a scientific text string.
See also:

- SuperScriptText::Set()

Example:

$t = new SuperScriptText();
$t->FromReal(12341.56);
// Will print 1.23*10^4

SuperScriptText ::
GetFontHeight($aImg)
Hight of font (approximate the height of the text)

Argument | Default | Description
--- | --- | ---
$aImg |  | No description available

Description:
Return height of text.
See also:

- SuperScriptText::GetTextHeight()
- SuperScriptText::GetWidth()

SuperScriptText ::
GetTextHeight($aImg)
Hight of text

Argument | Default | Description
--- | --- | ---
$aImg |  | No description available

Description:
Hight of text

SuperScriptText ::
GetWidth($aImg)
Total width of text

Argument | Default | Description
--- | --- | ---
$aImg |  | No description available

Description:
Total width of text

SuperScriptText ::
Set($aTxt, $aSuper)
Convert a floating point number to scientific notation

Argument | Default | Description
--- | --- | ---
$aTxt |  | Mantissa
$aSuper | '' | Exponent

Description:
Specify the string manuall by specifyin mantissa and exponent.
See also:

- SuperScriptText::FromReal()

Example:

$t = new SuperScriptText();
$t->Set("1.34 10","5");
// Will generate "1.34 10^5"

SuperScriptText ::
SetSuperFont($aFontFam, $aFontStyle, $aFontSize)
Manually set font to be used for superscript

Argument | Default | Description
--- | --- | ---
$aFontFam |  | Font family
$aFontStyle | FS_NORMAL | Font style
$aFontSize | 8 | Font size

Description:
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.

SuperScriptText ::
__construct($aTxt, $aSuper, $aXAbsPos, $aYAbsPos)
Constructor

Argument | Default | Description
--- | --- | ---
$aTxt | '' | Mantissa text
$aSuper | '' | Suoerscript text
$aXAbsPos | 0 | X-position (in pixels)
$aYAbsPos | 0 | Y-position (in pixels)

Description:
Creates a new SUperSCriptClass
See also:

- Text::__construct()