Public Member Functions | |
SurveyChart ($GraphTyp, $XSize, $YSize, $Titel, $XLabel, $YLabel, $DataArray) | |
makeDataForOneQuestion ($Data, $GraphTyp) | |
draw () | |
Data Fields | |
$graph | |
$graphData |
Definition at line 3 of file class.SurveyChart.php.
SurveyChart::draw | ( | ) |
Definition at line 59 of file class.SurveyChart.php.
Referenced by SurveyChart().
{ $this->graph->DrawGraph(); $this->graph->PrintImage(); }
SurveyChart::makeDataForOneQuestion | ( | $ | Data, | |
$ | GraphTyp | |||
) |
Definition at line 36 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"])); } } }
SurveyChart::SurveyChart | ( | $ | GraphTyp, | |
$ | XSize, | |||
$ | YSize, | |||
$ | Titel, | |||
$ | XLabel, | |||
$ | YLabel, | |||
$ | DataArray | |||
) |
Definition at line 12 of file class.SurveyChart.php.
References draw(), and makeDataForOneQuestion().
{ $this->graphData = array(); include_once ("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); $this->graph->SetTitle($Titel); $this->graph->SetXTitle($XLabel); $this->graph->SetYTitle($YLabel); $this->graph->SetXDataLabelPos("plotdown"); $this->makeDataForOneQuestion($DataArray, $GraphTyp); $this->graph->SetDataValues($this->graphData); $this->draw(); }
SurveyChart::$graph |
Definition at line 10 of file class.SurveyChart.php.
SurveyChart::$graphData |
Definition at line 11 of file class.SurveyChart.php.