ILIAS  release_8 Revision v8.24
ilChartDataBars Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 setLineWidth (int $a_value)
 
 getLineWidth ()
 
 setBarOptions (float $a_width, string $a_align="center", bool $a_horizontal=false)
 
- Public Member Functions inherited from ilChartData
 setHidden (bool $a_value)
 
 isHidden ()
 
 setLabel (string $a_value)
 
 getLabel ()
 
 addPoint (float $a_x, ?float $a_y=null)
 Set data. More...
 
 getData ()
 Get data. More...
 
 setFill (float $a_value, string $a_color="")
 
 getFill ()
 
 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 ()
 
 parseDataOptions (array &$a_options)
 Convert data options to flot config. More...
 
 getTypeString ()
 
 parseDataOptions (array &$a_options)
 Convert data options to flot config. More...
 

Protected Attributes

int $line_width = null
 
float $bar_width = 0
 
string $bar_align = ""
 
bool $bar_horizontal = false
 
- Protected Attributes inherited from ilChartData
string $type = ""
 
string $label = ""
 
array $data = []
 
float $fill = 0
 
string $fill_color = ""
 
bool $hidden = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too. If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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

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

Member Function Documentation

◆ getLineWidth()

ilChartDataBars::getLineWidth ( )

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

38 : ?int
39 {
40 return $this->line_width;
41 }

References $line_width.

◆ getTypeString()

ilChartDataBars::getTypeString ( )
protected

Reimplemented from ilChartData.

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

28 : string
29 {
30 return "bars";
31 }

◆ parseDataOptions()

ilChartDataBars::parseDataOptions ( array &  $a_options)
protected

Convert data options to flot config.

Reimplemented from ilChartData.

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

55 : void
56 {
57 $width = $this->getLineWidth();
58 if ($width !== null) {
59 $a_options["lineWidth"] = $width;
60 }
61
62 if ($this->bar_width) {
63 $a_options["barWidth"] = $this->bar_width;
64 $a_options["align"] = $this->bar_align;
65 if ($this->bar_horizontal) {
66 $a_options["horizontal"] = true;
67 }
68 }
69 }

◆ setBarOptions()

ilChartDataBars::setBarOptions ( float  $a_width,
string  $a_align = "center",
bool  $a_horizontal = false 
)

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

47 : void {
48 $this->bar_width = (float) str_replace(",", ".", (string) $a_width);
49 if (in_array($a_align, array("center", "left"))) {
50 $this->bar_align = $a_align;
51 }
52 $this->bar_horizontal = $a_horizontal;
53 }

◆ setLineWidth()

ilChartDataBars::setLineWidth ( int  $a_value)

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

33 : void
34 {
35 $this->line_width = $a_value;
36 }

Field Documentation

◆ $bar_align

string ilChartDataBars::$bar_align = ""
protected

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

◆ $bar_horizontal

bool ilChartDataBars::$bar_horizontal = false
protected

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

◆ $bar_width

float ilChartDataBars::$bar_width = 0
protected

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

◆ $line_width

int ilChartDataBars::$line_width = null
protected

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

Referenced by getLineWidth().


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