38 function SurveyChart($GraphTyp,$XSize,$YSize,$Titel,$XLabel,$YLabel,$DataArray)
40 $this->graphData = array();
41 include_once (
"./Modules/SurveyQuestionPool/phplot/phplot.php");
42 $this->graph =
new PHPlot($XSize,$YSize);
46 $this->graph->SetDataType(
"text-data-single");
49 $this->graph->SetDataType(
"text-data");
52 $this->graph->SetPlotType($GraphTyp);
53 if (strlen($Titel) > 40)
55 $this->graph->SetFont(
"title",
"benjamingothic.ttf", 6);
57 if (strlen($Titel) > 80)
59 $Titel = substr($Titel, 0, 80) .
"...";
61 $this->graph->SetTitle($Titel);
62 $this->graph->SetXTitle($XLabel);
63 $this->graph->SetYTitle($YLabel);
64 $this->graph->SetXDataLabelPos(
"plotdown");
67 foreach ($this->graphData as $value)
69 if ($value[1] > $max) $max = $value[1];
71 $this->graph->SetYTickIncrement(ceil($max / 4));
72 $this->graph->SetDataValues($this->graphData);
73 $this->graph->SetPlotAreaWorld(NULL, 0, NULL, NULL);
79 foreach ($Data as $value)
81 if (array_key_exists(
"title", $value))
86 array_push($this->graphData, array($value[
"title"], $value[
"selected"],
""));
89 array_push($this->graphData, array($value[
"title"], $value[
"selected"]));
95 array_push($this->graphData, array($value[
"value"], $value[
"selected"]));
102 $this->graph->DrawGraph();
103 $this->graph->PrintImage();