ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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. More...
 
 isHidden ()
 Is hidden? More...
 
 setLabel ($a_value)
 Set label. More...
 
 getLabel ()
 Get label. More...
 
 addPoint ($a_x, $a_y=null)
 Set data. More...
 
 getData ()
 Get data. More...
 
 setFill ($a_value, $a_color=null)
 Set fill. More...
 
 getFill ()
 Get fill. More...
 
 parseData (array &$a_data)
 Convert data to flot config. More...
 
 parseGlobalOptions (stdClass $a_options, ilChart $a_chart)
 Convert (global) properties to flot config. More...
 

Protected Member Functions

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

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

◆ addPoint()

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.

74 {
75 if ($a_y !== null) {
76 $this->data[] = array($a_x, $a_y);
77 } else {
78 $this->data[] = $a_x;
79 }
80 }
$this data['403_header']

References data.

◆ getData()

ilChartData::getData ( )

Get data.

Returns
array

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

88 {
89 return $this->data;
90 }

References $data.

Referenced by parseData().

+ Here is the caller graph for this function:

◆ getFill()

ilChartData::getFill ( )

Get fill.

Returns
array (fill, color)

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

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

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

+ Here is the caller graph for this function:

◆ getLabel()

ilChartData::getLabel ( )

Get label.

Returns
string

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

63 {
64 return $this->label;
65 }

References $label.

Referenced by parseData().

+ Here is the caller graph for this function:

◆ getTypeString()

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:

◆ isHidden()

ilChartData::isHidden ( )

Is hidden?

Returns
bool

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

43 {
44 return $this->hidden;
45 }

References $hidden.

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

+ Here is the caller graph for this function:

◆ parseData()

ilChartData::parseData ( array &  $a_data)

Convert data to flot config.

Parameters
array$a_data
Returns
object

Reimplemented in ilChartDataPie, and ilChartDataSpider.

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

133 {
134 $series = new stdClass();
135 $series->label = str_replace("\"", "\\\"", $this->getLabel());
136
137 $series->data = array();
138 foreach ($this->getData() as $point) {
139 $series->data[] = array($point[0], $point[1]);
140 }
141
142 $options = array("show"=>($this->isHidden() ? false : true));
143
144 $fill = $this->getFill();
145 if ($fill["fill"]) {
146 $options["fill"] = $fill["fill"];
147 if ($fill["color"]) {
148 $options["fillColor"] = ilChart::renderColor($fill["color"], $fill["fill"]);
149 }
150 }
151
153
154 $series->{$this->getTypeString()} = $options;
155
156 $a_data[] = $series;
157 }
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
getTypeString()
Get series type.
getFill()
Get fill.
parseDataOptions(array &$a_options)
Convert data options to flot config.
getData()
Get data.
getLabel()
Get label.
isHidden()
Is hidden?
static renderColor($a_value, $a_opacity=1)
Render html color code.

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

+ Here is the call graph for this function:

◆ parseDataOptions()

ilChartData::parseDataOptions ( array &  $a_options)
protected

Convert data options to flot config.

Parameters
array$a_options
ilChart$a_chart

Reimplemented in ilChartDataBars, ilChartDataLines, and ilChartDataPoints.

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

123 {
124 }

Referenced by parseData().

+ Here is the caller graph for this function:

◆ parseGlobalOptions()

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 165 of file class.ilChartData.php.

166 {
167 }

◆ setFill()

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

Set fill.

Parameters
float$a_value
string$a_color

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

99 {
100 $this->fill = $a_value;
101 if (ilChart::isValidColor($a_color)) {
102 $this->fill_color = $a_color;
103 }
104 }
static isValidColor($a_value)
Validate html color code.

References ilChart\isValidColor().

+ Here is the call graph for this function:

◆ setHidden()

ilChartData::setHidden (   $a_value)

Set hidden.

Parameters
bool$a_value

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

33 {
34 $this->hidden = (bool) $a_value;
35 }

◆ setLabel()

ilChartData::setLabel (   $a_value)

Set label.

Parameters
string$a_value

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

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

Field Documentation

◆ $data

ilChartData::$data
protected

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

Referenced by getData().

◆ $fill

ilChartData::$fill
protected

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

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

◆ $fill_color

ilChartData::$fill_color
protected

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

◆ $hidden

ilChartData::$hidden
protected

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

Referenced by isHidden().

◆ $label

ilChartData::$label
protected

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

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

◆ $type

ilChartData::$type
protected

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


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