src/Service/chartService.php
public function xyGraphRender(&$bizObj, &$xmlArr)
    {
        include_once (JPGRAPH_DIR.'/jpgraph.php');

        $graph = new Graph($xmlArr["ATTRIBUTES"]["WIDTH"],$xmlArr["ATTRIBUTES"]["HEIGHT"],"auto");
        //$graph->img->SetAntiAliasing();
        $graph->SetScale("textlin");
        $graph->yaxis->scale->SetGrace(10);
        list($m1, $m2, $m3, $m4) = explode(',', $xmlArr["ATTRIBUTES"]["MARGIN"]);
        $graph->img->SetMargin($m1, $m2, $m3, $m4);

        // get the data set
        foreach($xmlArr['DATASET']['DATA'] as $dtmp)
        {
            if ($xmlArr['DATASET']['DATA']['ATTRIBUTES'])
                $dtmp = $xmlArr['DATASET']['DATA'];
            $fieldName = $dtmp["ATTRIBUTES"]["FIELD"];
            if ($fieldName)
                $fields[$fieldName] = $fieldName;
        }

        $labelFld = $xmlArr['XAXIS']['ATTRIBUTES']['LABELFIELD'];

        $recArray = &$this->getPlotData($bizObj, $fields, $labelFld);

        $i = 0;
        foreach($xmlArr['DATASET']['DATA'] as $dtmp)
        {
            if ($xmlArr['DATASET']['DATA']['ATTRIBUTES'])
                $dtmp = $xmlArr['DATASET']['DATA'];
            $data = $recArray[$dtmp["ATTRIBUTES"]["FIELD"]];
            $plot = $this->renderXYPlot($data, $dtmp);
            if ($plot)
                $graph->Add($plot);
            $i++;
        }

        // render titles
        $graph->title->Set($xmlArr['TITLE']['ATTRIBUTES']['CAPTION']);
        $this->_drawString($graph->title,$xmlArr['TITLE']['ATTRIBUTES']['FONT'],$xmlArr['TITLE']['ATTRIBUTES']['COLOR']);

        // render xaxis
        $this->_drawAxis($graph->xaxis, $recArray[$labelFld],
                $xmlArr['XAXIS']['ATTRIBUTES']['FONT'], $xmlArr['XAXIS']['ATTRIBUTES']['COLOR'],
                $xmlArr['XAXIS']['ATTRIBUTES']['LABELANGLE'], $xmlArr['XAXIS']['ATTRIBUTES']['TITLE'],
                $xmlArr['XAXIS']['ATTRIBUTES']['TITLEFONT'], $xmlArr['XAXIS']['ATTRIBUTES']['TITLECOLOR'],
                $xmlArr['XAXIS']['ATTRIBUTES']['TITLEMARGIN']);
        // render yaxis
        $this->_drawAxis($graph->yaxis, null,
                $xmlArr['YAXIS']['ATTRIBUTES']['FONT'], $xmlArr['YAXIS']['ATTRIBUTES']['COLOR'],
                $xmlArr['YAXIS']['ATTRIBUTES']['LABELANGLE'], $xmlArr['YAXIS']['ATTRIBUTES']['TITLE'],
                $xmlArr['YAXIS']['ATTRIBUTES']['TITLEFONT'], $xmlArr['YAXIS']['ATTRIBUTES']['TITLECOLOR'],
                $xmlArr['YAXIS']['ATTRIBUTES']['TITLEMARGIN']);

        // render legend
        $this->_drawLegend($graph->legend,$xmlArr['LAGEND']['ATTRIBUTES']['POSITION'],
                $xmlArr['LAGEND']['ATTRIBUTES']['LAYOUT'], $xmlArr['legend']['ATTRIBUTES']['FONT'],
                $xmlArr['LAGEND']['ATTRIBUTES']['COLOR'], $xmlArr['legend']['ATTRIBUTES']['FILLCOLOR']);
        $graph->Stroke();
    }
public function xyGraphRender(&$bizObj, &$xmlArr)
    {
        include_once (JPGRAPH_DIR.'/jpgraph.php');

        $graph = new Graph($xmlArr["ATTRIBUTES"]["WIDTH"],$xmlArr["ATTRIBUTES"]["HEIGHT"],"auto");
        //$graph->img->SetAntiAliasing();
        $graph->SetScale("textlin");
        $graph->yaxis->scale->SetGrace(10);
        list($m1, $m2, $m3, $m4) = explode(',', $xmlArr["ATTRIBUTES"]["MARGIN"]);
        $graph->img->SetMargin($m1, $m2, $m3, $m4);

        // get the data set
        foreach($xmlArr['DATASET']['DATA'] as $dtmp)
        {
            if ($xmlArr['DATASET']['DATA']['ATTRIBUTES'])
                $dtmp = $xmlArr['DATASET']['DATA'];
            $fieldName = $dtmp["ATTRIBUTES"]["FIELD"];
            if ($fieldName)
                $fields[$fieldName] = $fieldName;
        }

        $labelFld = $xmlArr['XAXIS']['ATTRIBUTES']['LABELFIELD'];

        $recArray = &$this->getPlotData($bizObj, $fields, $labelFld);

        $i = 0;
        foreach($xmlArr['DATASET']['DATA'] as $dtmp)
        {
            if ($xmlArr['DATASET']['DATA']['ATTRIBUTES'])
                $dtmp = $xmlArr['DATASET']['DATA'];
            $data = $recArray[$dtmp["ATTRIBUTES"]["FIELD"]];
            $plot = $this->renderXYPlot($data, $dtmp);
            if ($plot)
                $graph->Add($plot);
            $i++;
        }

        // render titles
        $graph->title->Set($xmlArr['TITLE']['ATTRIBUTES']['CAPTION']);
        $this->_drawString($graph->title,$xmlArr['TITLE']['ATTRIBUTES']['FONT'],$xmlArr['TITLE']['ATTRIBUTES']['COLOR']);

        // render xaxis
        $this->_drawAxis($graph->xaxis, $recArray[$labelFld],
                $xmlArr['XAXIS']['ATTRIBUTES']['FONT'], $xmlArr['XAXIS']['ATTRIBUTES']['COLOR'],
                $xmlArr['XAXIS']['ATTRIBUTES']['LABELANGLE'], $xmlArr['XAXIS']['ATTRIBUTES']['TITLE'],
                $xmlArr['XAXIS']['ATTRIBUTES']['TITLEFONT'], $xmlArr['XAXIS']['ATTRIBUTES']['TITLECOLOR'],
                $xmlArr['XAXIS']['ATTRIBUTES']['TITLEMARGIN']);
        // render yaxis
        $this->_drawAxis($graph->yaxis, null,
                $xmlArr['YAXIS']['ATTRIBUTES']['FONT'], $xmlArr['YAXIS']['ATTRIBUTES']['COLOR'],
                $xmlArr['YAXIS']['ATTRIBUTES']['LABELANGLE'], $xmlArr['YAXIS']['ATTRIBUTES']['TITLE'],
                $xmlArr['YAXIS']['ATTRIBUTES']['TITLEFONT'], $xmlArr['YAXIS']['ATTRIBUTES']['TITLECOLOR'],
                $xmlArr['YAXIS']['ATTRIBUTES']['TITLEMARGIN']);

        // render legend
        $this->_drawLegend($graph->legend,$xmlArr['LAGEND']['ATTRIBUTES']['POSITION'],
                $xmlArr['LAGEND']['ATTRIBUTES']['LAYOUT'], $xmlArr['legend']['ATTRIBUTES']['FONT'],
                $xmlArr['LAGEND']['ATTRIBUTES']['COLOR'], $xmlArr['legend']['ATTRIBUTES']['FILLCOLOR']);
        $graph->Stroke();
    }
Draw the XY type graph (can have > 1 plots)

@param BizObj $bizObj object reference of bizobj
@param array $xmlArr xml array reference
@return void