ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 parseGlobalOptions (stdClass $a_options, ilChart $a_chart)
 Convert (global) properties to flot config.
- Public Member Functions inherited from ilChartData
 setHidden ($a_value)
 Set hidden.
 isHidden ()
 Is hidden?
 setLabel ($a_value)
 Set label.
 getLabel ()
 Get label.
 addPoint ($a_x, $a_y=null)
 Set data.
 getData ()
 Get data.
 setFill ($a_value, $a_color=null)
 Set fill.
 getFill ()
 Get fill.

Protected Member Functions

 getTypeString ()
 Get series type.
- Protected Member Functions inherited from ilChartData
 parseDataOptions (array &$a_options)
 Convert data options to flot config.

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

ilChartDataSpider::getTypeString ( )
protected

Get series type.

Returns
string

Reimplemented from ilChartData.

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

{
return "spider";
}
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.

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

{
$fill = $this->getFill();
if ($fill["color"] != "")
{
$a_data[count($a_data)-1]->color = ilChart::renderColor($fill["color"] , "0.5");
}
}

+ Here is the call graph for this function:

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.

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

{
$spider = new stdClass();
$spider->active = true;
$spider->highlight = new stdClass();
$spider->highlight->mode = "line";
$spider->legs = new stdClass();
$spider->legs->fillStyle = ilChart::renderColor("#000", "0.7");
switch (count($a_chart->getLegLabels()))
{
case 4:
case 6:
$spider->legs->legStartAngle = 10;
break;
default:
$spider->legs->legStartAngle = 0;
break;
}
$spider->legs->data = array();
$max_str_len = 0;
foreach ($a_chart->getLegLabels() as $l)
{
$l = ilUtil::shortenText ($l, 80, true);
$label = new stdClass();
$label->label = $l;
$spider->legs->data[] = $label;
$max_str_len = max($max_str_len, strlen($l));
}
// depending on caption length
if ($max_str_len > 60)
{
$font_size = 10;
}
else if ($max_str_len > 30)
{
$font_size = 12;
}
else
{
$font_size = 15;
}
$spider->legs->font = $font_size."px Arial";
$spider->spiderSize = 0.7;
$spider->lineWidth = 1;
$spider->pointSize = 0;
$spider->connection = new StdClass();
$spider->connection->width = 2;
$spider->legMin = 0.0000001;
$spider->legMax = $a_chart->getYAxisMax();
$a_options->series->spider = $spider;
}

+ Here is the call graph for this function:


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