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

Abstract chart data series base class. More...

+ Inheritance diagram for ilChartData:
+ Collaboration diagram for ilChartData:

Public Member Functions

 setHidden ($a_value)
 Set hidden.
 isHidden ()
 Is hidden?
 setLabel ($a_value)
 Set label.
 getLabel ()
 Get label.
 addPoint ($a_x, $a_y=null)
 Set data.
 getData ()
 Get data.
 setFill ($a_value, $a_color=null)
 Set fill.
 getFill ()
 Get fill.
 parseData (array &$a_data)
 Convert data to flot config.
 parseGlobalOptions (stdClass $a_options, ilChart $a_chart)
 Convert (global) properties to flot config.

Protected Member Functions

 getTypeString ()
 Get series type.
 parseDataOptions (array &$a_options)
 Convert data options to flot config.

Protected Attributes

 $type
 $label
 $data
 $fill
 $fill_color
 $hidden

Detailed Description

Abstract chart data series base class.

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.ilChartData.php.

Member Function Documentation

ilChartData::addPoint (   $a_x,
  $a_y = null 
)

Set data.

Parameters
float$a_x
float$a_y

Reimplemented in ilChartDataPie.

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

{
if($a_y !== null)
{
$this->data[] = array($a_x, $a_y);
}
else
{
$this->data[] = $a_x;
}
}
ilChartData::getData ( )

Get data.

Returns
array

Definition at line 90 of file class.ilChartData.php.

References $data.

Referenced by parseData().

{
return $this->data;
}

+ Here is the caller graph for this function:

ilChartData::getFill ( )

Get fill.

Returns
array (fill, color)

Definition at line 115 of file class.ilChartData.php.

Referenced by ilChartDataSpider\parseData(), and parseData().

{
return array("fill"=>$this->fill, "color"=>$this->fill_color);
}

+ Here is the caller graph for this function:

ilChartData::getLabel ( )

Get label.

Returns
string

Definition at line 62 of file class.ilChartData.php.

References $label.

Referenced by parseData().

{
return $this->label;
}

+ Here is the caller graph for this function:

ilChartData::getTypeString ( )
abstractprotected

Get series type.

Returns
string

Reimplemented in ilChartDataBars, ilChartDataLines, ilChartDataPie, ilChartDataPoints, and ilChartDataSpider.

Referenced by parseData().

+ Here is the caller graph for this function:

ilChartData::isHidden ( )

Is hidden?

Returns
bool

Definition at line 42 of file class.ilChartData.php.

References $hidden.

Referenced by ilChartDataPie\parseData(), and parseData().

{
return $this->hidden;
}

+ Here is the caller graph for this function:

ilChartData::parseData ( array &  $a_data)

Convert data to flot config.

Parameters
array$a_data
Returns
object

Reimplemented in ilChartDataPie, and ilChartDataSpider.

Definition at line 137 of file class.ilChartData.php.

References $fill, $options, getData(), getFill(), getLabel(), getTypeString(), isHidden(), parseDataOptions(), and ilChart\renderColor().

{
$series = new stdClass();
$series->label = str_replace("\"", "\\\"", $this->getLabel());
$series->data = array();
foreach($this->getData() as $point)
{
$series->data[] = array($point[0], $point[1]);
}
$options = array("show"=>($this->isHidden() ? false : true));
$fill = $this->getFill();
if($fill["fill"])
{
$options["fill"] = $fill["fill"];
if($fill["color"])
{
$options["fillColor"] = ilChart::renderColor($fill["color"], $fill["fill"]);
}
}
$series->{$this->getTypeString()} = $options;
$a_data[] = $series;
}

+ Here is the call graph for this function:

ilChartData::parseDataOptions ( array &  $a_options)
protected

Convert data options to flot config.

Parameters
array$a_options
ilChart$a_chart

Reimplemented in ilChartDataLines, ilChartDataPoints, and ilChartDataBars.

Definition at line 126 of file class.ilChartData.php.

Referenced by parseData().

{
}

+ Here is the caller graph for this function:

ilChartData::parseGlobalOptions ( stdClass  $a_options,
ilChart  $a_chart 
)

Convert (global) properties to flot config.

Parameters
object$a_options
ilChart$a_chart

Reimplemented in ilChartDataPie, and ilChartDataSpider.

Definition at line 173 of file class.ilChartData.php.

{
}
ilChartData::setFill (   $a_value,
  $a_color = null 
)

Set fill.

Parameters
float$a_value
string$a_color

Definition at line 101 of file class.ilChartData.php.

References ilChart\isValidColor().

{
$this->fill = $a_value;
if(ilChart::isValidColor($a_color))
{
$this->fill_color = $a_color;
}
}

+ Here is the call graph for this function:

ilChartData::setHidden (   $a_value)

Set hidden.

Parameters
bool$a_value

Definition at line 32 of file class.ilChartData.php.

{
$this->hidden = (bool)$a_value;
}
ilChartData::setLabel (   $a_value)

Set label.

Parameters
string$a_value

Definition at line 52 of file class.ilChartData.php.

{
$this->label = (string)$a_value;
}

Field Documentation

ilChartData::$data
protected

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

Referenced by getData().

ilChartData::$fill
protected

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

Referenced by ilChartDataSpider\parseData(), and parseData().

ilChartData::$fill_color
protected

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

ilChartData::$hidden
protected

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

Referenced by isHidden().

ilChartData::$label
protected

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

Referenced by getLabel(), and ilChartDataSpider\parseGlobalOptions().

ilChartData::$type
protected

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


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