src/Service/chartService.php
public function renderXYPlot(&$data, &$xmlArr)
    {
        $id = $xmlArr['ATTRIBUTES']['ID'];
        $field = $xmlArr['ATTRIBUTES']['FIELD'];
        $chartType = $xmlArr['ATTRIBUTES']['CHARTTYPE'];
        $pointType = $xmlArr['ATTRIBUTES']['POINTTYPE'];
        $weight = $xmlArr['ATTRIBUTES']['WEIGHT'];
        $color = $xmlArr['ATTRIBUTES']['COLOR'];
        $fillColor = $xmlArr['ATTRIBUTES']['FILLCOLOR'];
        $showVal = $xmlArr['ATTRIBUTES']['SHOWVALUE'];
        $legend = $xmlArr['ATTRIBUTES']['LEGENDFIELD'];
        $visible = $xmlArr['ATTRIBUTES']['VISIBLE'];

        if ($chartType == 'Line' or $chartType == 'Bar')
        {
            if ($chartType == 'Line')
            {
                include_once (JPGRAPH_DIR.'/jpgraph_line.php');
                $plot = new LinePlot($data);
                $this->_drawMark($plot->mark,
                        $xmlArr['POINTMARK']['ATTRIBUTES']['TYPE'], $xmlArr['POINTMARK']['ATTRIBUTES']['COLOR'],
                        $xmlArr['POINTMARK']['ATTRIBUTES']['FILLCOLOR'], $xmlArr['POINTMARK']['ATTRIBUTES']['SIZE']);
                $plot->SetBarCenter();
                $plot->SetCenter();
            }
            else if ($chartType == 'Bar')
            {
                include_once (JPGRAPH_DIR.'/jpgraph_bar.php');
                $plot = new BarPlot($data);
                $plot->SetAlign('center');
            }
            if ($color) $plot->SetColor($color);
            if ($fillColor) $plot->SetFillColor($fillColor);
            if ($weight) $plot->SetWeight($weight);
            if ($showVal == 1) $plot->value->Show();
            if ($legend) $plot->SetLegend($legend);
            $this->_drawString($plot->value,$xmlArr['VALUE']['ATTRIBUTES']['FONT'],$xmlArr['VALUE']['ATTRIBUTES']['COLOR']);
        }

        if ($chartType == 'GroupBar' or $chartType == 'AccBar')
        {
            $children = $xmlArr['ATTRIBUTES']['CHILDREN'];
            $childList = explode(",",$children);
            foreach($childList as $child)
            {
                $childPlotList[] = $this->plotList[$child];
            }
            if ($chartType == 'GroupBar')
                $plot = new GroupBarPlot($childPlotList);
            else if ($chartType == 'AccBar')
                $plot = new AccBarPlot($childPlotList);
        }

        $this->plotList[$id] = $plot;

        if ($visible == 1)
            return $plot;
        return null;
    }
public function renderXYPlot(&$data, &$xmlArr)
    {
        $id = $xmlArr['ATTRIBUTES']['ID'];
        $field = $xmlArr['ATTRIBUTES']['FIELD'];
        $chartType = $xmlArr['ATTRIBUTES']['CHARTTYPE'];
        $pointType = $xmlArr['ATTRIBUTES']['POINTTYPE'];
        $weight = $xmlArr['ATTRIBUTES']['WEIGHT'];
        $color = $xmlArr['ATTRIBUTES']['COLOR'];
        $fillColor = $xmlArr['ATTRIBUTES']['FILLCOLOR'];
        $showVal = $xmlArr['ATTRIBUTES']['SHOWVALUE'];
        $legend = $xmlArr['ATTRIBUTES']['LEGENDFIELD'];
        $visible = $xmlArr['ATTRIBUTES']['VISIBLE'];

        if ($chartType == 'Line' or $chartType == 'Bar')
        {
            if ($chartType == 'Line')
            {
                include_once (JPGRAPH_DIR.'/jpgraph_line.php');
                $plot = new LinePlot($data);
                $this->_drawMark($plot->mark,
                        $xmlArr['POINTMARK']['ATTRIBUTES']['TYPE'], $xmlArr['POINTMARK']['ATTRIBUTES']['COLOR'],
                        $xmlArr['POINTMARK']['ATTRIBUTES']['FILLCOLOR'], $xmlArr['POINTMARK']['ATTRIBUTES']['SIZE']);
                $plot->SetBarCenter();
                $plot->SetCenter();
            }
            else if ($chartType == 'Bar')
            {
                include_once (JPGRAPH_DIR.'/jpgraph_bar.php');
                $plot = new BarPlot($data);
                $plot->SetAlign('center');
            }
            if ($color) $plot->SetColor($color);
            if ($fillColor) $plot->SetFillColor($fillColor);
            if ($weight) $plot->SetWeight($weight);
            if ($showVal == 1) $plot->value->Show();
            if ($legend) $plot->SetLegend($legend);
            $this->_drawString($plot->value,$xmlArr['VALUE']['ATTRIBUTES']['FONT'],$xmlArr['VALUE']['ATTRIBUTES']['COLOR']);
        }

        if ($chartType == 'GroupBar' or $chartType == 'AccBar')
        {
            $children = $xmlArr['ATTRIBUTES']['CHILDREN'];
            $childList = explode(",",$children);
            foreach($childList as $child)
            {
                $childPlotList[] = $this->plotList[$child];
            }
            if ($chartType == 'GroupBar')
                $plot = new GroupBarPlot($childPlotList);
            else if ($chartType == 'AccBar')
                $plot = new AccBarPlot($childPlotList);
        }

        $this->plotList[$id] = $plot;

        if ($visible == 1)
            return $plot;
        return null;
    }
Draw the XY type plot

@param array $data plot data array reference
@param array $xmlArr xml array reference
@return object refernce XY plot object reference