ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilChartDataSpider 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 ilChartDataSpider:
+ Collaboration diagram for ilChartDataSpider:

Public Member Functions

 parseData (array &$a_data)
 
 parseGlobalOptions (stdClass $a_options, ilChart $a_chart)
 
- 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 ()
 
- Protected Member Functions inherited from ilChartData
 getTypeString ()
 
 parseDataOptions (array &$a_options)
 Convert data options to flot config. More...
 

Additional Inherited Members

- 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 spider 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 20 of file class.ilChartDataSpider.php.

Member Function Documentation

◆ getTypeString()

ilChartDataSpider::getTypeString ( )
protected

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

22  : string
23  {
24  return "spider";
25  }

◆ parseData()

ilChartDataSpider::parseData ( array &  $a_data)

Definition at line 27 of file class.ilChartDataSpider.php.

References ilChartData\$fill, ilChartData\getFill(), and ilChart\renderColor().

27  : void
28  {
29  parent::parseData($a_data);
30 
31  $fill = $this->getFill();
32  if ($fill["color"] != "") {
33  $a_data[count($a_data) - 1]->color = ilChart::renderColor($fill["color"], 0.5);
34  }
35  }
static renderColor(string $a_value, float $a_opacity=1)
Render html color code.
+ Here is the call graph for this function:

◆ parseGlobalOptions()

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

Definition at line 37 of file class.ilChartDataSpider.php.

References ilChartData\$label, ilChart\renderColor(), and ilStr\shortenTextExtended().

37  : void
38  {
39  $spider = new stdClass();
40  $spider->active = true;
41 
42  $spider->highlight = new stdClass();
43  $spider->highlight->mode = "line";
44 
45 
46  $spider->legs = new stdClass();
47  $spider->legs->fillStyle = ilChart::renderColor("#000", 0.7);
48  switch (count($a_chart->getLegLabels())) {
49  case 4:
50  case 6:
51  $spider->legs->legStartAngle = 10;
52  break;
53 
54  default:
55  $spider->legs->legStartAngle = 0;
56  break;
57  }
58 
59  $spider->legs->data = array();
60 
61  $max_str_len = 0;
62  foreach ($a_chart->getLegLabels() as $l) {
63  $l = ilStr::shortenTextExtended($l, 80, true);
64 
65  $label = new stdClass();
66  $label->label = $l;
67  $spider->legs->data[] = $label;
68 
69  $max_str_len = max($max_str_len, strlen($l));
70  }
71 
72  // depending on caption length
73  if ($max_str_len > 60) {
74  $font_size = 10;
75  } elseif ($max_str_len > 30) {
76  $font_size = 12;
77  } else {
78  $font_size = 15;
79  }
80  $spider->legs->font = $font_size . "px Arial";
81 
82  $spider->spiderSize = 0.7;
83  $spider->lineWidth = 1;
84  $spider->pointSize = 0;
85 
86  $spider->connection = new stdClass();
87  $spider->connection->width = 2;
88 
89  $spider->legMin = 0.0000001;
90  $spider->legMax = $a_chart->getYAxisMax();
91 
92  $a_options->series->spider = $spider;
93  }
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
static renderColor(string $a_value, float $a_opacity=1)
Render html color code.
+ Here is the call graph for this function:

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