40 function SurveyChart($GraphTyp,$XSize,$YSize,$Titel,$XLabel,$YLabel,$DataArray)
42 $this->graphData = array();
43 include_once (
"./Modules/SurveyQuestionPool/phplot/phplot.php");
44 $this->graph =
new PHPlot($XSize,$YSize);
48 $this->graph->SetDataType(
"text-data-single");
51 $this->graph->SetDataType(
"text-data");
54 $this->graph->SetPlotType($GraphTyp);
55 if (strlen($Titel) > 40)
57 $this->graph->SetFont(
"title",
"benjamingothic.ttf", 6);
59 if (strlen($Titel) > 80)
61 $Titel = substr($Titel, 0, 80) .
"...";
63 $this->graph->SetTitle($Titel);
64 $this->graph->SetXTitle($XLabel);
65 $this->graph->SetYTitle($YLabel);
66 $this->graph->SetXDataLabelPos(
"plotdown");
69 foreach ($this->graphData as $value)
71 if ($value[1] > $max) $max = $value[1];
73 $this->graph->SetYTickIncrement(ceil($max / 4));
74 $this->graph->SetDataValues($this->graphData);
75 $this->graph->SetPlotAreaWorld(NULL, 0, NULL, NULL);
81 foreach ($Data as $value)
83 if (array_key_exists(
"title", $value))
88 array_push($this->graphData, array($value[
"title"], $value[
"selected"],
""));
91 array_push($this->graphData, array($value[
"title"], $value[
"selected"]));
97 array_push($this->graphData, array($value[
"value"], $value[
"selected"]));
104 $this->graph->DrawGraph();
105 $this->graph->PrintImage();