Class SurveyChart. More...
Public Member Functions | |
| SurveyChart ($GraphTyp, $XSize, $YSize, $Titel, $XLabel, $YLabel, $DataArray) | |
| makeDataForOneQuestion ($Data, $GraphTyp) | |
| draw () | |
Data Fields | |
| $graph | |
| $graphData | |
Class SurveyChart.
Definition at line 33 of file class.SurveyChart.php.
| 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:| SurveyChart::$graph |
Definition at line 35 of file class.SurveyChart.php.
| SurveyChart::$graphData |
Definition at line 36 of file class.SurveyChart.php.
1.7.1