ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilChartSpider Class Reference

Generator for spider charts. More...

+ Inheritance diagram for ilChartSpider:
+ Collaboration diagram for ilChartSpider:

Public Member Functions

 getDataInstance ($a_type=null)
 Get data series instance. More...
 
 setLegLabels ($a_val)
 Set leg labels. More...
 
 getLegLabels ()
 Get leg labels. More...
 
 setYAxisMax ($a_val)
 Set y axis max value. More...
 
 getYAxisMax ()
 Get y axis max value. More...
 
 parseGlobalOptions (stdClass $a_options)
 Convert (global) properties to flot config. More...
 
- Public Member Functions inherited from ilChart
 getDataInstance ($a_type=null)
 Get data series instance. More...
 
 setSize ($a_x, $a_y)
 Set chart size. More...
 
 addData (ilChartData $a_series, $a_idx=null)
 Add data series. More...
 
 setLegend (ilChartLegend $a_legend)
 Set chart legend. More...
 
 setColors ($a_values)
 Set colors. More...
 
 getColors ()
 Get colors. More...
 
 setShadow ($a_value)
 Set shadow. More...
 
 getShadow ()
 Get shadow. More...
 
 setAutoResize ($a_value)
 Toggle auto-resizing on window resize/redraw. More...
 
 parseGlobalOptions (stdClass $a_options)
 Convert (global) properties to flot config. More...
 
 getHTML ()
 Render. More...
 

Protected Member Functions

 isValidDataType (ilChartData $a_series)
 Validate data series. More...
 
 addCustomJS ()
 Add type-specific JS script. More...
 
- Protected Member Functions inherited from ilChart
 __construct ($a_id)
 Constructor. More...
 
 isValidDataType (ilChartData $a_series)
 Validate data series. More...
 
 isValid ()
 Basic validation. More...
 
 initJS ()
 Init JS script files. More...
 
 addCustomJS ()
 Add type-specific JS script. More...
 

Protected Attributes

 $leg_labels = array()
 
 $y_max = 0
 
- Protected Attributes inherited from ilChart
 $id
 
 $width
 
 $height
 
 $data
 
 $legend
 
 $shadow
 
 $colors
 
 $auto_resize
 

Additional Inherited Members

- Static Public Member Functions inherited from ilChart
static getInstanceByType ($a_type, $a_id)
 Get type instance. More...
 
static isValidColor ($a_value)
 Validate html color code. More...
 
static renderColor ($a_value, $a_opacity=1)
 Render html color code. More...
 
- Data Fields inherited from ilChart
const TYPE_GRID = 1
 
const TYPE_PIE = 2
 
const TYPE_SPIDER = 3
 

Detailed Description

Generator for spider charts.

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.ilChartSpider.php.

Member Function Documentation

◆ addCustomJS()

ilChartSpider::addCustomJS ( )
protected

Add type-specific JS script.

Reimplemented from ilChart.

Definition at line 70 of file class.ilChartSpider.php.

71 {
72 global $tpl;
73
74 $tpl->addJavascript("Services/Chart/js/flot/jquery.flot.highlighter.js");
75 $tpl->addJavascript("Services/Chart/js/flot/jquery.flot.spider.js");
76 }
global $tpl
Definition: ilias.php:8

References $tpl.

◆ getDataInstance()

ilChartSpider::getDataInstance (   $a_type = null)

Get data series instance.

Returns
ilChartData

Reimplemented from ilChart.

Definition at line 18 of file class.ilChartSpider.php.

19 {
20 include_once "Services/Chart/classes/class.ilChartDataSpider.php";
21 return new ilChartDataSpider();
22 }
Chart data spider series.

◆ getLegLabels()

ilChartSpider::getLegLabels ( )

Get leg labels.

Returns
array leg labels (array of strings)

Definition at line 44 of file class.ilChartSpider.php.

45 {
46 return $this->leg_labels;
47 }

References $leg_labels.

◆ getYAxisMax()

ilChartSpider::getYAxisMax ( )

Get y axis max value.

Returns
float y axis max value

Definition at line 65 of file class.ilChartSpider.php.

66 {
67 return $this->y_max;
68 }

References $y_max.

Referenced by parseGlobalOptions().

+ Here is the caller graph for this function:

◆ isValidDataType()

ilChartSpider::isValidDataType ( ilChartData  $a_series)
protected

Validate data series.

Returns
bool

Reimplemented from ilChart.

Definition at line 24 of file class.ilChartSpider.php.

25 {
26 return ($a_series instanceof ilChartDataSpider);
27 }

◆ parseGlobalOptions()

ilChartSpider::parseGlobalOptions ( stdClass  $a_options)

Convert (global) properties to flot config.

Parameters
object$a_options

Reimplemented from ilChart.

Definition at line 78 of file class.ilChartSpider.php.

79 {
80 $a_options->grid = new stdClass();
81 $a_options->grid->hoverable = false;
82 $a_options->grid->clickable = false;
83 $a_options->grid->ticks = $this->getYAxisMax();
84 $a_options->grid->tickColor = ilChart::renderColor("#000", "0.1");
85 $a_options->grid->mode = "spider";
86 }
getYAxisMax()
Get y axis max value.
static renderColor($a_value, $a_opacity=1)
Render html color code.

References getYAxisMax(), and ilChart\renderColor().

+ Here is the call graph for this function:

◆ setLegLabels()

ilChartSpider::setLegLabels (   $a_val)

Set leg labels.

Parameters
array$a_valleg labels (array of strings)

Definition at line 34 of file class.ilChartSpider.php.

35 {
36 $this->leg_labels = $a_val;
37 }

◆ setYAxisMax()

ilChartSpider::setYAxisMax (   $a_val)

Set y axis max value.

Parameters
float$a_valy axis max value

Definition at line 55 of file class.ilChartSpider.php.

56 {
57 $this->y_max = $a_val;
58 }

Field Documentation

◆ $leg_labels

ilChartSpider::$leg_labels = array()
protected

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

Referenced by getLegLabels().

◆ $y_max

ilChartSpider::$y_max = 0
protected

Definition at line 16 of file class.ilChartSpider.php.

Referenced by getYAxisMax().


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