PHP 클래스 Graph, GotCms

파일 보기 프로젝트 열기: gotcms/gotcms 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$defs
$force_assoc
$gradients
$javascript
$legend_reverse
$link_base
$link_target
$links
$namespaces
$settings
$values

공개 메소드들

메소드 설명
DrawGraph ( ) Draws the selected graph
Fetch ( $header = TRUE, $defer_javascript = TRUE ) Returns the SVG document
FetchJavascript ( $onload_immediate = TRUE, $cdata_wrap = TRUE, $no_namespace = TRUE ) When using the defer_javascript option, this returns the Javascript block
InsertComment ( $details ) Insert a comment into the Javascript section - handy for debugging!
InsertVariable ( $var, $value, $more = NULL, $quote = TRUE ) Adds a Javascript variable - use $value:$more for assoc - use null:$more for array
Links ( ) Sets the links from each item
NewID ( ) Creates a new ID for an element
RelativePosition ( $pos, $top, $left, $bottom, $right, $width, $height, $pad, $text = false ) Returns the [x,y] position that is $pos relative to the top, left, bottom and right. When $text is true, returns [x,y,align right]
Render ( $header = TRUE, $content_type = TRUE, $defer_javascript = FALSE ) Renders the SVG document
Settings ( &$settings ) Sets the options
Values ( $values ) Sets the graph values
__construct ( $w, $h, $settings = NULL )
__get ( $name ) Retrieves properties from the settings array if they are not already available as properties

보호된 메소드들

메소드 설명
AddEventHandler ( &$array, $evt, $code ) Adds an inline event handler to an element's array
AddFunction ( $name ) Adds one or more javascript functions
AddOverlay ( $from, $to ) Add an overlaid copy of an element, with opacity of 0 $from and $to are the IDs of the source and destination
AssociativeKeys ( ) Checks if the keys are associative
AutoHide ( &$element ) Makes something auto-hide
BackgroundImage ( ) Displays the background image
Canvas ( $id ) Displays the background
CheckValues ( &$values ) Checks that the data are valid
ContrastText ( $x, $y, $text, $fcolour = 'black', $bcolour = 'white', $properties = NULL, $styles = NULL ) Displays high-contrast text
CountLines ( $text ) Returns the number of lines in a string
Draw ( ) This should be overridden by subclass!
DrawLegend ( ) Draws the legend
DrawLegendEntry ( $key, $x, $y, $w, $h ) Subclasses must draw the entry, if they can
DrawTitle ( ) Draws the graph title, if there is one
Element ( $name, $attribs = NULL, $styles = NULL, $content = NULL ) Draws an element
ErrorText ( $error ) Displays readable (hopefully) error message
GetColour ( $key, $no_gradient = FALSE ) Returns a colour reference
GetFirst ( ) Returns the first non-empty argument
GetKey ( $index ) Returns the key value for an index, if associative
GetLink ( $key, $content, $row ) Retrieves a link
GetLinkURL ( $key, $row ) Returns a link URL or NULL if none
GetMaxKey ( ) Returns the maximum key value
GetMaxValue ( ) Returns the maximum value
GetMinKey ( ) Returns the minimum key value
GetMinValue ( ) Returns the minimum value
GetValues ( $row ) Returns a row of values
ParsePosition ( $pos, $w, $h, $pad ) Parses a position string, returning x and y coordinates
SetDraggable ( &$element ) Makes an item draggable
SetFader ( &$element, $in, $out, $target = NULL, $duplicate = FALSE ) Sets the fader for an element
SetStroke ( &$attr, $line_join = null ) Sets the stroke options for an element
SetTooltip ( &$element, $key, $value = NULL, $duplicate = FALSE ) Default tooltip contents are key and value, or whatever $key is if $value is not set
Text ( $text, $line_spacing, $attribs, $styles = NULL ) Returns a text element, with tspans for subsequent lines
TextFit ( $text, $x, $y, $w, $h, $attribs = NULL, $styles = NULL ) Fits text to a box - text will be bottom-aligned
TextLines ( $text, $x, $line_spacing ) Formats lines of text
TextSize ( $text, $font_size, $font_adjust, $angle, $line_spacing ) Returns [width,height] of text $text = string OR text length
TooltipText ( $key, $value = NULL ) Sets the text to use for a tooltip

비공개 메소드들

메소드 설명
LoadJavascript ( ) Loads the Javascript class
MakeLinearGradient ( $id, $colours ) Creates a linear gradient element

메소드 상세

AddEventHandler() 보호된 메소드

Adds an inline event handler to an element's array
protected AddEventHandler ( &$array, $evt, $code )

AddFunction() 보호된 메소드

Adds one or more javascript functions
protected AddFunction ( $name )

AddOverlay() 보호된 메소드

Add an overlaid copy of an element, with opacity of 0 $from and $to are the IDs of the source and destination
protected AddOverlay ( $from, $to )

AssociativeKeys() 보호된 메소드

Checks if the keys are associative
protected AssociativeKeys ( )

AutoHide() 보호된 메소드

Makes something auto-hide
protected AutoHide ( &$element )

BackgroundImage() 보호된 메소드

Displays the background image
protected BackgroundImage ( )

Canvas() 보호된 메소드

Displays the background
protected Canvas ( $id )

CheckValues() 보호된 메소드

Checks that the data are valid
protected CheckValues ( &$values )

ContrastText() 보호된 메소드

Displays high-contrast text
protected ContrastText ( $x, $y, $text, $fcolour = 'black', $bcolour = 'white', $properties = NULL, $styles = NULL )

CountLines() 보호된 정적인 메소드

Returns the number of lines in a string
protected static CountLines ( $text )

Draw() 추상적인 보호된 메소드

This should be overridden by subclass!
abstract protected Draw ( )

DrawGraph() 공개 메소드

Draws the selected graph
public DrawGraph ( )

DrawLegend() 보호된 메소드

Draws the legend
protected DrawLegend ( )

DrawLegendEntry() 보호된 메소드

Subclasses must draw the entry, if they can
protected DrawLegendEntry ( $key, $x, $y, $w, $h )

DrawTitle() 보호된 메소드

Draws the graph title, if there is one
protected DrawTitle ( )

Element() 보호된 메소드

Draws an element
protected Element ( $name, $attribs = NULL, $styles = NULL, $content = NULL )

ErrorText() 보호된 메소드

Displays readable (hopefully) error message
protected ErrorText ( $error )

Fetch() 공개 메소드

Returns the SVG document
public Fetch ( $header = TRUE, $defer_javascript = TRUE )

FetchJavascript() 공개 메소드

When using the defer_javascript option, this returns the Javascript block
public FetchJavascript ( $onload_immediate = TRUE, $cdata_wrap = TRUE, $no_namespace = TRUE )

GetColour() 보호된 메소드

Returns a colour reference
protected GetColour ( $key, $no_gradient = FALSE )

GetFirst() 보호된 정적인 메소드

Returns the first non-empty argument
protected static GetFirst ( )

GetKey() 보호된 메소드

Returns the key value for an index, if associative
protected GetKey ( $index )

GetLinkURL() 보호된 메소드

Returns a link URL or NULL if none
protected GetLinkURL ( $key, $row )

GetMaxKey() 보호된 메소드

Returns the maximum key value
protected GetMaxKey ( )

GetMaxValue() 보호된 메소드

Returns the maximum value
protected GetMaxValue ( )

GetMinKey() 보호된 메소드

Returns the minimum key value
protected GetMinKey ( )

GetMinValue() 보호된 메소드

Returns the minimum value
protected GetMinValue ( )

GetValues() 보호된 메소드

Returns a row of values
protected GetValues ( $row )

InsertComment() 공개 메소드

Insert a comment into the Javascript section - handy for debugging!
public InsertComment ( $details )

InsertVariable() 공개 메소드

Adds a Javascript variable - use $value:$more for assoc - use null:$more for array
public InsertVariable ( $var, $value, $more = NULL, $quote = TRUE )

NewID() 공개 메소드

Creates a new ID for an element
public NewID ( )

ParsePosition() 보호된 메소드

Parses a position string, returning x and y coordinates
protected ParsePosition ( $pos, $w, $h, $pad )

RelativePosition() 공개 정적인 메소드

Returns the [x,y] position that is $pos relative to the top, left, bottom and right. When $text is true, returns [x,y,align right]
public static RelativePosition ( $pos, $top, $left, $bottom, $right, $width, $height, $pad, $text = false )

Render() 공개 메소드

Renders the SVG document
public Render ( $header = TRUE, $content_type = TRUE, $defer_javascript = FALSE )

SetDraggable() 보호된 메소드

Makes an item draggable
protected SetDraggable ( &$element )

SetFader() 보호된 메소드

Sets the fader for an element
protected SetFader ( &$element, $in, $out, $target = NULL, $duplicate = FALSE )

SetStroke() 보호된 메소드

Sets the stroke options for an element
protected SetStroke ( &$attr, $line_join = null )

SetTooltip() 보호된 메소드

Default tooltip contents are key and value, or whatever $key is if $value is not set
protected SetTooltip ( &$element, $key, $value = NULL, $duplicate = FALSE )

Settings() 공개 메소드

Sets the options
public Settings ( &$settings )

Text() 보호된 메소드

Returns a text element, with tspans for subsequent lines
protected Text ( $text, $line_spacing, $attribs, $styles = NULL )

TextFit() 보호된 메소드

Fits text to a box - text will be bottom-aligned
protected TextFit ( $text, $x, $y, $w, $h, $attribs = NULL, $styles = NULL )

TextLines() 보호된 메소드

Formats lines of text
protected TextLines ( $text, $x, $line_spacing )

TextSize() 보호된 메소드

Returns [width,height] of text $text = string OR text length
protected TextSize ( $text, $font_size, $font_adjust, $angle, $line_spacing )

TooltipText() 보호된 메소드

Sets the text to use for a tooltip
protected TooltipText ( $key, $value = NULL )

Values() 공개 메소드

Sets the graph values
public Values ( $values )

__construct() 공개 메소드

public __construct ( $w, $h, $settings = NULL )

__get() 공개 메소드

Retrieves properties from the settings array if they are not already available as properties
public __get ( $name )

프로퍼티 상세

$defs 보호되어 있는 프로퍼티

protected $defs

$force_assoc 보호되어 있는 프로퍼티

protected $force_assoc

$gradients 보호되어 있는 프로퍼티

protected $gradients

$javascript 보호되어 있는 정적으로 프로퍼티

protected static $javascript

$legend_reverse 보호되어 있는 프로퍼티

protected $legend_reverse

$namespaces 보호되어 있는 프로퍼티

protected $namespaces

$settings 보호되어 있는 프로퍼티

protected $settings

$values 보호되어 있는 프로퍼티

protected $values