ILIAS  release_4-4 Revision
ilChartLegend Class Reference

Chart legend. More...

+ Collaboration diagram for ilChartLegend:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setPosition ($a_position)
 Set Position. More...
 
 getPosition ()
 Get Position. More...
 
 setColumns ($a_value)
 Set number of columns. More...
 
 getColumns ()
 Get number of columns. More...
 
 setMargin ($a_x, $a_y)
 Set margins. More...
 
 getMargin ()
 Get margins. More...
 
 setBackground ($a_color)
 Set background color. More...
 
 getBackground ()
 Get background color. More...
 
 setOpacity ($a_value)
 Set Opacity. More...
 
 getOpacity ()
 Get opacity. More...
 
 setLabelBorder ($a_color)
 Set label border. More...
 
 getLabelBorder ()
 Get label border. More...
 

Protected Attributes

 $position
 
 $columns
 
 $margin_x
 
 $margin_y
 
 $background
 
 $opacity
 
 $border
 

Detailed Description

Chart legend.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 11 of file class.ilChartLegend.php.

Constructor & Destructor Documentation

◆ __construct()

ilChartLegend::__construct ( )

Constructor.

Definition at line 24 of file class.ilChartLegend.php.

References setBackground(), setColumns(), setLabelBorder(), setMargin(), setOpacity(), and setPosition().

25  {
26  $this->setPosition("ne");
27  $this->setColumns(1);
28  $this->setMargin(5, 5);
29  $this->setBackground("#888");
30  $this->setOpacity(0.1);
31  $this->setLabelBorder("#bbb");
32  }
setLabelBorder($a_color)
Set label border.
setMargin($a_x, $a_y)
Set margins.
setOpacity($a_value)
Set Opacity.
setColumns($a_value)
Set number of columns.
setBackground($a_color)
Set background color.
setPosition($a_position)
Set Position.
+ Here is the call graph for this function:

Member Function Documentation

◆ getBackground()

ilChartLegend::getBackground ( )

Get background color.

Returns
string

Definition at line 118 of file class.ilChartLegend.php.

References $background.

119  {
120  return $this->background;
121  }

◆ getColumns()

ilChartLegend::getColumns ( )

Get number of columns.

Returns
int

Definition at line 73 of file class.ilChartLegend.php.

References $columns.

74  {
75  return $this->columns;
76  }

◆ getLabelBorder()

ilChartLegend::getLabelBorder ( )

Get label border.

Returns
string

Definition at line 165 of file class.ilChartLegend.php.

References $border.

166  {
167  return $this->border;
168  }

◆ getMargin()

ilChartLegend::getMargin ( )

Get margins.

Returns
array (x, y)

Definition at line 95 of file class.ilChartLegend.php.

96  {
97  return array("x"=>$this->margin_x, "y"=>$this->margin_y);
98  }

◆ getOpacity()

ilChartLegend::getOpacity ( )

Get opacity.

Returns
float

Definition at line 142 of file class.ilChartLegend.php.

References $opacity.

143  {
144  return $this->opacity;
145  }

◆ getPosition()

ilChartLegend::getPosition ( )

Get Position.

Returns
string

Definition at line 53 of file class.ilChartLegend.php.

References $position.

54  {
55  return $this->position;
56  }

◆ setBackground()

ilChartLegend::setBackground (   $a_color)

Set background color.

Parameters
string$a_color

Definition at line 105 of file class.ilChartLegend.php.

References ilChart\isValidColor().

Referenced by __construct().

106  {
107  if(ilChart::isValidColor($a_color))
108  {
109  $this->background = $a_color;
110  }
111  }
static isValidColor($a_value)
Validate html color code.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setColumns()

ilChartLegend::setColumns (   $a_value)

Set number of columns.

Parameters
int$a_value

Definition at line 63 of file class.ilChartLegend.php.

Referenced by __construct().

64  {
65  $this->columns = (int)$a_value;
66  }
+ Here is the caller graph for this function:

◆ setLabelBorder()

ilChartLegend::setLabelBorder (   $a_color)

Set label border.

Parameters
string$a_color

Definition at line 152 of file class.ilChartLegend.php.

References ilChart\isValidColor().

Referenced by __construct().

153  {
154  if(ilChart::isValidColor($a_color))
155  {
156  $this->border = $a_color;
157  }
158  }
static isValidColor($a_value)
Validate html color code.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMargin()

ilChartLegend::setMargin (   $a_x,
  $a_y 
)

Set margins.

Parameters
int$a_x
int$a_y

Definition at line 84 of file class.ilChartLegend.php.

Referenced by __construct().

85  {
86  $this->margin_x = (int)$a_x;
87  $this->margin_y = (int)$a_y;
88  }
+ Here is the caller graph for this function:

◆ setOpacity()

ilChartLegend::setOpacity (   $a_value)

Set Opacity.

Parameters
float$a_value

Definition at line 128 of file class.ilChartLegend.php.

Referenced by __construct().

129  {
130  $a_value = (float)$a_value;
131  if($a_value >= 0 && $a_value <= 1)
132  {
133  $this->opacity = $a_value;
134  }
135  }
+ Here is the caller graph for this function:

◆ setPosition()

ilChartLegend::setPosition (   $a_position)

Set Position.

Parameters
string$position

Definition at line 39 of file class.ilChartLegend.php.

Referenced by __construct().

40  {
41  $all = array("ne", "nw", "se", "sw");
42  if(in_array((string)$a_position, $all))
43  {
44  $this->position = (string)$a_position;
45  }
46  }
+ Here is the caller graph for this function:

Field Documentation

◆ $background

ilChartLegend::$background
protected

Definition at line 17 of file class.ilChartLegend.php.

Referenced by getBackground().

◆ $border

ilChartLegend::$border
protected

Definition at line 19 of file class.ilChartLegend.php.

Referenced by getLabelBorder().

◆ $columns

ilChartLegend::$columns
protected

Definition at line 14 of file class.ilChartLegend.php.

Referenced by getColumns().

◆ $margin_x

ilChartLegend::$margin_x
protected

Definition at line 15 of file class.ilChartLegend.php.

◆ $margin_y

ilChartLegend::$margin_y
protected

Definition at line 16 of file class.ilChartLegend.php.

◆ $opacity

ilChartLegend::$opacity
protected

Definition at line 18 of file class.ilChartLegend.php.

Referenced by getOpacity().

◆ $position

ilChartLegend::$position
protected

Definition at line 13 of file class.ilChartLegend.php.

Referenced by getPosition().


The documentation for this class was generated from the following file: