ILIAS  release_8 Revision v8.23
class.ilChartSpider.php
Go to the documentation of this file.
1 <?php
2 
20 class ilChartSpider extends ilChart
21 {
22  protected array $leg_labels = array();
23  protected float $y_max = 0;
24 
25  public function getDataInstance(int $a_type = null): ilChartData
26  {
27  return new ilChartDataSpider();
28  }
29 
30  protected function isValidDataType(ilChartData $a_series): bool
31  {
32  return ($a_series instanceof ilChartDataSpider);
33  }
34 
39  public function setLegLabels(array $a_val): void
40  {
41  $this->leg_labels = $a_val;
42  }
43 
48  public function getLegLabels(): array
49  {
50  return $this->leg_labels;
51  }
52 
53 
58  public function setYAxisMax(float $a_val): void
59  {
60  $this->y_max = $a_val;
61  }
62 
67  public function getYAxisMax(): float
68  {
69  return $this->y_max;
70  }
71 
72  protected function addCustomJS(): void
73  {
74  $tpl = $this->tpl;
75 
76  $tpl->addJavaScript("Services/Chart/js/flot/jquery.flot.highlighter.js");
77  $tpl->addJavaScript("Services/Chart/js/flot/jquery.flot.spider.js");
78  }
79 
80  public function parseGlobalOptions(stdClass $a_options): void
81  {
82  $a_options->grid = new stdClass();
83  $a_options->grid->hoverable = false;
84  $a_options->grid->clickable = false;
85  $a_options->grid->ticks = $this->getYAxisMax();
86  $a_options->grid->tickColor = ilChart::renderColor("#000", "0.1");
87  $a_options->grid->mode = "spider";
88  }
89 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
parseGlobalOptions(stdClass $a_options)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getYAxisMax()
Get y axis max value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setYAxisMax(float $a_val)
Set y axis max value.
getDataInstance(int $a_type=null)
ilGlobalTemplateInterface $tpl
isValidDataType(ilChartData $a_series)
getLegLabels()
Get leg labels.
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
setLegLabels(array $a_val)
Set leg labels.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static renderColor(string $a_value, float $a_opacity=1)
Render html color code.