ILIAS  trunk Revision v11.0_alpha-1862-g4e205cb56d4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 23 of file class.ilChartDataSpider.php.

Member Function Documentation

◆ getTypeString()

ilChartDataSpider::getTypeString ( )
protected

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

25  : string
26  {
27  return "spider";
28  }

◆ parseData()

ilChartDataSpider::parseData ( array &  $a_data)

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

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

30  : void
31  {
32  parent::parseData($a_data);
33 
34  $fill = $this->getFill();
35  if ($fill["color"] != "") {
36  $a_data[count($a_data) - 1]->color = ilChart::renderColor($fill["color"], 0.5);
37  }
38  }
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 40 of file class.ilChartDataSpider.php.

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

40  : void
41  {
42  $spider = new stdClass();
43  $spider->active = true;
44 
45  $spider->highlight = new stdClass();
46  $spider->highlight->mode = "line";
47 
48 
49  $spider->legs = new stdClass();
50  $spider->legs->fillStyle = ilChart::renderColor("#000", 0.7);
51  switch (count($a_chart->getLegLabels())) {
52  case 4:
53  case 6:
54  $spider->legs->legStartAngle = 10;
55  break;
56 
57  default:
58  $spider->legs->legStartAngle = 0;
59  break;
60  }
61 
62  $spider->legs->data = array();
63 
64  $max_str_len = 0;
65  foreach ($a_chart->getLegLabels() as $l) {
66  $l = ilStr::shortenTextExtended($l, 80, true);
67 
68  $label = new stdClass();
69  $label->label = $l;
70  $spider->legs->data[] = $label;
71 
72  $max_str_len = max($max_str_len, strlen($l));
73  }
74 
75  // depending on caption length
76  if ($max_str_len > 60) {
77  $font_size = 10;
78  } elseif ($max_str_len > 30) {
79  $font_size = 12;
80  } else {
81  $font_size = 15;
82  }
83  $spider->legs->font = $font_size . "px Arial";
84 
85  $spider->spiderSize = 0.7;
86  $spider->lineWidth = 1;
87  $spider->pointSize = 0;
88 
89  $spider->connection = new stdClass();
90  $spider->connection->width = 2;
91 
92  $spider->legMin = 0.0000001;
93  $spider->legMax = $a_chart->getYAxisMax();
94 
95  $a_options->series->spider = $spider;
96  }
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: