ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilChartData Class Reference

Chart data series. More...

+ Collaboration diagram for ilChartData:

Public Member Functions

 __construct ($a_type)
 Constructor. More...
 
 setType ($a_value)
 Set type. More...
 
 getType ()
 Get type. More...
 
 setHidden ($a_value)
 Set hidden. More...
 
 isHidden ()
 Is hidden? More...
 
 isValidType ($a_value)
 Is given type valid? More...
 
 setLabel ($a_value)
 Set label. More...
 
 getLabel ()
 Get label. More...
 
 addPoint ($a_x, $a_y=null)
 Set data. More...
 
 getData ()
 Get data. More...
 
 setLineWidth ($a_value)
 Set line width. More...
 
 getLineWidth ()
 Get line width. More...
 
 setLineSteps ($a_value)
 Set line steps. More...
 
 getLineSteps ()
 Get line steps. More...
 
 setBarOptions ($a_width, $a_align="center", $a_horizontal=false)
 Set bar options. More...
 
 getBarOptions ()
 Get bar options. More...
 
 setPointRadius ($a_value)
 Set radius. More...
 
 getPointRadius ()
 Get radius. More...
 
 setFill ($a_value, $a_color=null)
 Set fill. More...
 
 getFill ()
 Get fill. More...
 

Protected Attributes

 $type
 
 $label
 
 $data
 
 $line_width
 
 $bar_width
 
 $bar_align
 
 $bar_horizontal
 
 $radius
 
 $steps
 
 $fill
 
 $fill_color
 
 $hidden
 

Detailed Description

Chart data series.

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.

Constructor & Destructor Documentation

◆ __construct()

ilChartData::__construct (   $a_type)

Constructor.

Parameters
string$a_type

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

References setType().

32  {
33  $this->setType($a_type);
34  }
setType($a_value)
Set type.
+ Here is the call graph for this function:

Member Function Documentation

◆ addPoint()

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

Set data.

Parameters
float$a_x
float$a_y

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

122  {
123  if($a_y !== null)
124  {
125  $this->data[] = array($a_x, $a_y);
126  }
127  else
128  {
129  $this->data[] = $a_x;
130  }
131  }

◆ getBarOptions()

ilChartData::getBarOptions ( )

Get bar options.

Returns
array (width, align, horizontal)

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

206  {
207  return array("width" => $this->bar_width,
208  "align" => $this->bar_align,
209  "horizontal" => $this->bar_horizontal);
210  }

◆ getData()

ilChartData::getData ( )

Get data.

Returns
array

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

References $data.

139  {
140  return $this->data;
141  }

◆ getFill()

ilChartData::getFill ( )

Get fill.

Returns
array (fill, color)

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

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

◆ getLabel()

ilChartData::getLabel ( )

Get label.

Returns
string

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

References $label.

111  {
112  return $this->label;
113  }

◆ getLineSteps()

ilChartData::getLineSteps ( )

Get line steps.

Returns
bool

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

References $steps.

179  {
180  return $this->steps;
181  }

◆ getLineWidth()

ilChartData::getLineWidth ( )

Get line width.

Returns
int

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

References $line_width.

159  {
160  return $this->line_width;
161  }

◆ getPointRadius()

ilChartData::getPointRadius ( )

Get radius.

Returns
int

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

References $radius.

228  {
229  return $this->radius;
230  }

◆ getType()

ilChartData::getType ( )

Get type.

Returns
string

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

References $type.

55  {
56  return $this->type;
57  }

◆ isHidden()

ilChartData::isHidden ( )

Is hidden?

Returns
bool

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

References $hidden.

75  {
76  return $this->hidden;
77  }

◆ isValidType()

ilChartData::isValidType (   $a_value)

Is given type valid?

Parameters
string$a_value
Returns
bool

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

Referenced by setType().

86  {
87  $all = array("lines", "bars", "points", "pie", "spider");
88  if(in_array((string)$a_value, $all))
89  {
90  return true;
91  }
92  return false;
93  }
+ Here is the caller graph for this function:

◆ setBarOptions()

ilChartData::setBarOptions (   $a_width,
  $a_align = "center",
  $a_horizontal = false 
)

Set bar options.

Parameters
float$a_width
string$a_align
bool$a_horizontal

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

191  {
192  $this->bar_width = (float)$a_width;
193  if(in_array((string)$a_align, array("center", "left")))
194  {
195  $this->bar_align = (string)$a_align;
196  }
197  $this->bar_horizontal = (bool)$a_horizontal;
198  }

◆ setFill()

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

Set fill.

Parameters
float$a_value
string$a_color

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

References ilChart\isValidColor().

239  {
240  $this->fill = $a_value;
241  if(ilChart::isValidColor($a_color))
242  {
243  $this->fill_color = $a_color;
244  }
245  }
static isValidColor($a_value)
Validate html color code.
+ Here is the call graph for this function:

◆ setHidden()

ilChartData::setHidden (   $a_value)

Set hidden.

Parameters
bool$a_value

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

65  {
66  $this->hidden = (bool)$a_value;
67  }

◆ setLabel()

ilChartData::setLabel (   $a_value)

Set label.

Parameters
string$a_value

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

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

◆ setLineSteps()

ilChartData::setLineSteps (   $a_value)

Set line steps.

Parameters
bool$a_value

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

169  {
170  $this->steps = (bool)$a_value;
171  }

◆ setLineWidth()

ilChartData::setLineWidth (   $a_value)

Set line width.

Parameters
int$a_value

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

149  {
150  $this->line_width = (int)$a_value;
151  }

◆ setPointRadius()

ilChartData::setPointRadius (   $a_value)

Set radius.

Parameters
int$a_value

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

218  {
219  $this->radius = (int)$a_value;
220  }

◆ setType()

ilChartData::setType (   $a_value)

Set type.

Parameters
string$a_value

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

References isValidType().

Referenced by __construct().

42  {
43  if($this->isValidType($a_value))
44  {
45  $this->type = (string)$a_value;
46  }
47  }
isValidType($a_value)
Is given type valid?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $bar_align

ilChartData::$bar_align
protected

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

◆ $bar_horizontal

ilChartData::$bar_horizontal
protected

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

◆ $bar_width

ilChartData::$bar_width
protected

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

◆ $data

ilChartData::$data
protected

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

Referenced by getData().

◆ $fill

ilChartData::$fill
protected

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

◆ $fill_color

ilChartData::$fill_color
protected

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

◆ $hidden

ilChartData::$hidden
protected

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

Referenced by isHidden().

◆ $label

ilChartData::$label
protected

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

Referenced by getLabel().

◆ $line_width

ilChartData::$line_width
protected

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

Referenced by getLineWidth().

◆ $radius

ilChartData::$radius
protected

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

Referenced by getPointRadius().

◆ $steps

ilChartData::$steps
protected

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

Referenced by getLineSteps().

◆ $type

ilChartData::$type
protected

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

Referenced by getType().


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