ILIAS  release_7 Revision v7.30-3-g800a261c036
ilChartDataSpider Class Reference

Chart data spider series. More...

+ Inheritance diagram for ilChartDataSpider:
+ Collaboration diagram for ilChartDataSpider:

Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from ilChartData
 $type
 
 $label
 
 $data
 
 $fill
 
 $fill_color
 
 $hidden
 

Detailed Description

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
Version
$Id$

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

Member Function Documentation

◆ getTypeString()

ilChartDataSpider::getTypeString ( )
protected

Get series type.

Returns
string

Reimplemented from ilChartData.

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

16 {
17 return "spider";
18 }

◆ parseData()

ilChartDataSpider::parseData ( array &  $a_data)

Convert data to flot config.

Parameters
array$a_data
Returns
object

Reimplemented from ilChartData.

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

21 {
22 parent::parseData($a_data);
23
24 $fill = $this->getFill();
25 if ($fill["color"] != "") {
26 $a_data[count($a_data) - 1]->color = ilChart::renderColor($fill["color"], "0.5");
27 }
28 }
getFill()
Get fill.
static renderColor($a_value, $a_opacity=1)
Render html color code.

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

+ Here is the call graph for this function:

◆ parseGlobalOptions()

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

Convert (global) properties to flot config.

Parameters
object$a_options
ilChart$a_chart

Reimplemented from ilChartData.

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

31 {
32 $spider = new stdClass();
33 $spider->active = true;
34
35 $spider->highlight = new stdClass();
36 $spider->highlight->mode = "line";
37
38
39 $spider->legs = new stdClass();
40 $spider->legs->fillStyle = ilChart::renderColor("#000", "0.7");
41 switch (count($a_chart->getLegLabels())) {
42 case 4:
43 case 6:
44 $spider->legs->legStartAngle = 10;
45 break;
46
47 default:
48 $spider->legs->legStartAngle = 0;
49 break;
50 }
51
52 $spider->legs->data = array();
53
54 $max_str_len = 0;
55 foreach ($a_chart->getLegLabels() as $l) {
56 $l = ilUtil::shortenText($l, 80, true);
57
58 $label = new stdClass();
59 $label->label = $l;
60 $spider->legs->data[] = $label;
61
62 $max_str_len = max($max_str_len, strlen($l));
63 }
64
65 // depending on caption length
66 if ($max_str_len > 60) {
67 $font_size = 10;
68 } elseif ($max_str_len > 30) {
69 $font_size = 12;
70 } else {
71 $font_size = 15;
72 }
73 $spider->legs->font = $font_size . "px Arial";
74
75 $spider->spiderSize = 0.7;
76 $spider->lineWidth = 1;
77 $spider->pointSize = 0;
78
79 $spider->connection = new StdClass();
80 $spider->connection->width = 2;
81
82 $spider->legMin = 0.0000001;
83 $spider->legMax = $a_chart->getYAxisMax();
84
85 $a_options->series->spider = $spider;
86 }
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.

References ilChartData\$label, ilChart\renderColor(), and ilUtil\shortenText().

+ Here is the call graph for this function:

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