ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilChartDataBars Class Reference

Chart data bars series. More...

+ Inheritance diagram for ilChartDataBars:
+ Collaboration diagram for ilChartDataBars:

Public Member Functions

 setLineWidth ($a_value)
 Set line width. More...
 
 getLineWidth ()
 Get line width. More...
 
 setBarOptions ($a_width, $a_align="center", $a_horizontal=false)
 Set bar options. More...
 
- Public Member Functions inherited from ilChartData
 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...
 
 getTypeString ()
 Get series type. More...
 
 parseDataOptions (array &$a_options)
 Convert data options to flot config. More...
 

Protected Attributes

 $line_width
 
 $bar_width
 
 $bar_align
 
 $bar_horizontal
 
- Protected Attributes inherited from ilChartData
 $type
 
 $label
 
 $data
 
 $fill
 
 $fill_color
 
 $hidden
 

Detailed Description

Chart data bars 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 13 of file class.ilChartDataBars.php.

Member Function Documentation

◆ getLineWidth()

ilChartDataBars::getLineWidth ( )

Get line width.

Returns
int

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

References $line_width.

Referenced by parseDataOptions().

+ Here is the caller graph for this function:

◆ getTypeString()

ilChartDataBars::getTypeString ( )
protected

Get series type.

Returns
string

Reimplemented from ilChartData.

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

21 {
22 return "bars";
23 }

◆ parseDataOptions()

ilChartDataBars::parseDataOptions ( array &  $a_options)
protected

Convert data options to flot config.

Parameters
array$a_options
ilChart$a_chart

Reimplemented from ilChartData.

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

63 {
64 $width = $this->getLineWidth();
65 if($width !== null)
66 {
67 $a_options["lineWidth"] = $width;
68 }
69
70 if($this->bar_width)
71 {
72 $a_options["barWidth"] = $this->bar_width;
73 $a_options["align"] = $this->bar_align;
74 if($this->bar_horizontal)
75 {
76 $a_options["horizontal"] = true;
77 }
78 }
79 }
getLineWidth()
Get line width.

References $bar_align, $bar_width, and getLineWidth().

+ Here is the call graph for this function:

◆ setBarOptions()

ilChartDataBars::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 52 of file class.ilChartDataBars.php.

53 {
54 $this->bar_width = (float)str_replace(",", ".", $a_width);
55 if(in_array((string)$a_align, array("center", "left")))
56 {
57 $this->bar_align = (string)$a_align;
58 }
59 $this->bar_horizontal = (bool)$a_horizontal;
60 }

◆ setLineWidth()

ilChartDataBars::setLineWidth (   $a_value)

Set line width.

Parameters
int$a_value

Definition at line 30 of file class.ilChartDataBars.php.

31 {
32 $this->line_width = (int)$a_value;
33 }

Field Documentation

◆ $bar_align

ilChartDataBars::$bar_align
protected

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

Referenced by parseDataOptions().

◆ $bar_horizontal

ilChartDataBars::$bar_horizontal
protected

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

◆ $bar_width

ilChartDataBars::$bar_width
protected

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

Referenced by parseDataOptions().

◆ $line_width

ilChartDataBars::$line_width
protected

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

Referenced by getLineWidth().


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