ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 {
27 $a_data[count($a_data)-1]->color = ilChart::renderColor($fill["color"] , "0.5");
28 }
29 }
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 31 of file class.ilChartDataSpider.php.

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

References $l, 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: