ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
SurveyChart Class Reference

Class SurveyChart. More...

+ Collaboration diagram for SurveyChart:

Public Member Functions

 SurveyChart ($GraphTyp, $XSize, $YSize, $Titel, $XLabel, $YLabel, $DataArray)
 makeDataForOneQuestion ($Data, $GraphTyp)
 draw ()

Data Fields

 $graph
 $graphData

Detailed Description

Class SurveyChart.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Version
Id:
class.SurveyChart.php 18633 2009-01-20 17:17:19Z hschottm

Definition at line 33 of file class.SurveyChart.php.

Member Function Documentation

SurveyChart::draw ( )

Definition at line 100 of file class.SurveyChart.php.

Referenced by SurveyChart().

{
$this->graph->DrawGraph();
$this->graph->PrintImage();
}

+ Here is the caller graph for this function:

SurveyChart::makeDataForOneQuestion (   $Data,
  $GraphTyp 
)

Definition at line 77 of file class.SurveyChart.php.

Referenced by SurveyChart().

{
foreach ($Data as $value)
{
if (array_key_exists("title", $value))
{
switch ($GraphTyp)
{
case "pie":
array_push($this->graphData, array($value["title"], $value["selected"], ""));
break;
default:
array_push($this->graphData, array($value["title"], $value["selected"]));
break;
}
}
else
{
array_push($this->graphData, array($value["value"], $value["selected"]));
}
}
}

+ Here is the caller graph for this function:

SurveyChart::SurveyChart (   $GraphTyp,
  $XSize,
  $YSize,
  $Titel,
  $XLabel,
  $YLabel,
  $DataArray 
)

Definition at line 38 of file class.SurveyChart.php.

References draw(), and makeDataForOneQuestion().

{
$this->graphData = array();
include_once ("./Modules/SurveyQuestionPool/phplot/phplot.php");
$this->graph = new PHPlot($XSize,$YSize);
switch ($GraphTyp)
{
case "pie":
$this->graph->SetDataType("text-data-single");
break;
default:
$this->graph->SetDataType("text-data");
break;
}
$this->graph->SetPlotType($GraphTyp);
if (strlen($Titel) > 40)
{
$this->graph->SetFont("title", "benjamingothic.ttf", 6);
}
if (strlen($Titel) > 80)
{
$Titel = substr($Titel, 0, 80) . "...";
}
$this->graph->SetTitle($Titel);
$this->graph->SetXTitle($XLabel);
$this->graph->SetYTitle($YLabel);
$this->graph->SetXDataLabelPos("plotdown");
$this->makeDataForOneQuestion($DataArray, $GraphTyp);
$max = 0;
foreach ($this->graphData as $value)
{
if ($value[1] > $max) $max = $value[1];
}
$this->graph->SetYTickIncrement(ceil($max / 4));
$this->graph->SetDataValues($this->graphData);
$this->graph->SetPlotAreaWorld(NULL, 0, NULL, NULL);
$this->draw();
}

+ Here is the call graph for this function:

Field Documentation

SurveyChart::$graph

Definition at line 35 of file class.SurveyChart.php.

SurveyChart::$graphData

Definition at line 36 of file class.SurveyChart.php.


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