Public Member Functions | Data Fields

SurveyChart Class Reference

Public Member Functions

 SurveyChart ($GraphTyp, $XSize, $YSize, $Titel, $XLabel, $YLabel, $DataArray)
 makeDataForOneQuestion ($Data, $GraphTyp)
 draw ()

Data Fields

 $graph
 $graphData

Detailed Description

Definition at line 3 of file class.SurveyChart.php.


Member Function Documentation

SurveyChart::draw (  ) 

Definition at line 59 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 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"]));
                        }
                }
        }

Here is the caller graph for this function:

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

Here is the call graph for this function:


Field Documentation

SurveyChart::$graph

Definition at line 10 of file class.SurveyChart.php.

SurveyChart::$graphData

Definition at line 11 of file class.SurveyChart.php.


The documentation for this class was generated from the following file: