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);
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();