ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChartLegend Class Reference

Chart legend. More...

+ Collaboration diagram for ilChartLegend:

Public Member Functions

 __construct ()
 Constructor.
 setPosition ($a_position)
 Set Position.
 getPosition ()
 Get Position.
 setColumns ($a_value)
 Set number of columns.
 getColumns ()
 Get number of columns.
 setMargin ($a_x, $a_y)
 Set margins.
 getMargin ()
 Get margins.
 setBackground ($a_color)
 Set background color.
 getBackground ()
 Get background color.
 setOpacity ($a_value)
 Set Opacity.
 getOpacity ()
 Get opacity.
 setLabelBorder ($a_color)
 Set label border.
 getLabelBorder ()
 Get label border.
 setContainer ($a_value)
 Set container id.
 getContainer ()
 Get container id.
 parseOptions (stdClass $a_options)
 Convert (global) properties to flot config.

Protected Attributes

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

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

ilChartLegend::__construct ( )

Constructor.

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

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

{
$this->setPosition("ne");
$this->setColumns(1);
$this->setMargin(5, 5);
$this->setBackground("#888");
$this->setOpacity(0.1);
$this->setLabelBorder("#bbb");
}

+ Here is the call graph for this function:

Member Function Documentation

ilChartLegend::getBackground ( )

Get background color.

Returns
string

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

References $background.

Referenced by parseOptions().

{
}

+ Here is the caller graph for this function:

ilChartLegend::getColumns ( )

Get number of columns.

Returns
int

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

References $columns.

Referenced by parseOptions().

{
}

+ Here is the caller graph for this function:

ilChartLegend::getContainer ( )

Get container id.

Returns
string

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

References $container.

Referenced by parseOptions().

{
}

+ Here is the caller graph for this function:

ilChartLegend::getLabelBorder ( )

Get label border.

Returns
string

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

References $border.

Referenced by parseOptions().

{
return $this->border;
}

+ Here is the caller graph for this function:

ilChartLegend::getMargin ( )

Get margins.

Returns
array (x, y)

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

Referenced by parseOptions().

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

+ Here is the caller graph for this function:

ilChartLegend::getOpacity ( )

Get opacity.

Returns
float

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

References $opacity.

Referenced by parseOptions().

{
}

+ Here is the caller graph for this function:

ilChartLegend::getPosition ( )

Get Position.

Returns
string

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

References $position.

Referenced by parseOptions().

{
}

+ Here is the caller graph for this function:

ilChartLegend::parseOptions ( stdClass  $a_options)

Convert (global) properties to flot config.

Parameters
object$a_options

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

References $container, getBackground(), getColumns(), getContainer(), getLabelBorder(), getMargin(), getOpacity(), getPosition(), and ilChart\renderColor().

{
$a_options->show = true;
$a_options->noColumns = $this->getColumns();
$a_options->position = $this->getPosition();
$margin = $this->getMargin();
$a_options->margin = array($margin["x"], $margin["y"]);
$a_options->backgroundColor = ilChart::renderColor($this->getBackground());
$a_options->backgroundOpacity = str_replace(",",".",$this->getOpacity());
$a_options->labelBoxBorderColor = ilChart::renderColor($this->getLabelBorder());
{
$a_options->container = '#'.$container;
}
}

+ Here is the call graph for this function:

ilChartLegend::setBackground (   $a_color)

Set background color.

Parameters
string$a_color

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

References ilChart\isValidColor().

Referenced by __construct().

{
if(ilChart::isValidColor($a_color))
{
$this->background = $a_color;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChartLegend::setColumns (   $a_value)

Set number of columns.

Parameters
int$a_value

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

Referenced by __construct().

{
$this->columns = (int)$a_value;
}

+ Here is the caller graph for this function:

ilChartLegend::setContainer (   $a_value)

Set container id.

Parameters
string

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

{
$this->container = trim($a_value);
}
ilChartLegend::setLabelBorder (   $a_color)

Set label border.

Parameters
string$a_color

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

References ilChart\isValidColor().

Referenced by __construct().

{
if(ilChart::isValidColor($a_color))
{
$this->border = $a_color;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChartLegend::setMargin (   $a_x,
  $a_y 
)

Set margins.

Parameters
int$a_x
int$a_y

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

Referenced by __construct().

{
$this->margin_x = (int)$a_x;
$this->margin_y = (int)$a_y;
}

+ Here is the caller graph for this function:

ilChartLegend::setOpacity (   $a_value)

Set Opacity.

Parameters
float$a_value

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

Referenced by __construct().

{
$a_value = (float)$a_value;
if($a_value >= 0 && $a_value <= 1)
{
$this->opacity = $a_value;
}
}

+ Here is the caller graph for this function:

ilChartLegend::setPosition (   $a_position)

Set Position.

Parameters
string$position

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

Referenced by __construct().

{
$all = array("ne", "nw", "se", "sw");
if(in_array((string)$a_position, $all))
{
$this->position = (string)$a_position;
}
}

+ Here is the caller graph for this function:

Field Documentation

ilChartLegend::$background
protected

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

Referenced by getBackground().

ilChartLegend::$border
protected

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

Referenced by getLabelBorder().

ilChartLegend::$columns
protected

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

Referenced by getColumns().

ilChartLegend::$container
protected

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

Referenced by getContainer(), and parseOptions().

ilChartLegend::$margin_x
protected

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

ilChartLegend::$margin_y
protected

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

ilChartLegend::$opacity
protected

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

Referenced by getOpacity().

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: