Get the data series type(s) for a chart plot series

@param 	PHPExcel_Chart_PlotArea		$plotArea
@return	string|array
@throws 	PHPExcel_Writer_Exception
769935
private static function _getChartType($plotArea)
	{
		$groupCount = $plotArea->getPlotGroupCount();

		if ($groupCount == 1) {
			$chartType = array($plotArea->getPlotGroupByIndex(0)->getPlotType());
		} else {
			$chartTypes = array();
			for($i = 0; $i < $groupCount; ++$i) {
				$chartTypes[] = $plotArea->getPlotGroupByIndex($i)->getPlotType();
			}
			$chartType = array_unique($chartTypes);
			if (count($chartTypes) == 0) {
				throw new PHPExcel_Writer_Exception('Chart is not yet implemented');
			}
		}

		return $chartType;
	}
653470
private function getDataType($data)
    {
        if (is_string($data)) {
            return "'".$data."'";
        }

        if (is_numeric($data)) {
            return $data;
        }

        if (is_array($data)) {
            return 'Array';
        }

        if (is_bool($data)) {
            return $data ? 'true' : 'false';
        }

        if (is_object($data)) {
            return get_class($data);
        }

        if (is_null($data)) {
            return 'null';
        }

        return 'unknown';
    }
1284331
public function getGeometricMean($Serie)
    {
        if (isset($this->Data["Series"][$Serie])) {
            $SerieData = $this->stripVOID($this->Data["Series"][$Serie]["Data"]);
            $Seriesum = 1;
            foreach ($SerieData as $Value) {
                $Seriesum = $Seriesum * $Value;
            }
            return pow($Seriesum, 1 / sizeof($SerieData));
        }

        return null;
    }
917304
public function getOptionsForSeries( $series )
    {
        $seriesTitle = $this->getSeriesTitle( $series );
        if (! isset( $this->options['seriesStorage'][$seriesTitle] ) ) {
            throw new \Exception( 'Series not registered with JsWriter' );
        } 
        return $this->options['seriesStorage'][$seriesTitle];
    }
860839
private function serializeArea(Area $area)
    {
        $areaData = [
            'id' => $area->getUuid(),
            'color' => $area->getColor(),
        ];

        $position = explode(',', $area->getValue());

        switch ($area->getShape()) {
            case 'circle':
                $areaData['shape'] = 'circle';
                $areaData['radius'] = $area->getSize() / 2;

                // We store the top left corner, so we need to calculate the real center
                $center = $this->serializeCoords($position);
                $center['x'] += $areaData['radius'];
                $center['y'] += $areaData['radius'];
                $areaData['center'] = $center;

                break;
            // For retro-compatibility purpose.
            // It doesn't exist anymore in the schema and is handled as rect
            case 'square':
                $areaData['shape'] = 'rect';
                $areaData['coords'] = [
                    // top-left coords
                    $this->serializeCoords($position),
                    // bottom-right coords
                    $this->serializeCoords([$position[0] + $area->getSize(), $position[1] + $area->getSize()]),
                ];
                break;
            case 'rect':
                $areaData['shape'] = 'rect';
                $areaData['coords'] = [
                    $this->serializeCoords(array_slice($position, 0, 2)),
                    $this->serializeCoords(array_slice($position, 2, 2)),
                ];
                break;
        }

        return $areaData;
    }
212100
public function getScriptObjects($area)
    {
        $areas = [
            'top',
            'below'
        ];

        if (! in_array($area, $areas)) {
            Throw new PageException('Wrong scriptarea.');
        }

        return array_merge($this->core_js[$area], $this->app_js[$area]);
    }
1007237
public static function getCode($chartName, array $series, $type = 'lines', $points = false, $labels = true)
    {
        $points = $points ? 'true' : 'false';
        //nagłówek
        $html = '$(function () {';
        $html = trim($html, ', ') . ';';
        $min = 1000000000000;
        $max = -1000000000000;
        $tickSeries = [];
        $j = 0;
        //pętla po seriach
        foreach ($series as $chart) {
            $i = 0;
            $first = true;
            $html .= $chartName . '_' . str_replace('-', '_', $chart['object']) . '_' . $j . ' = [';
            foreach ($chart['data'] as $label => $count) {
                $i++;
                if ($count < $min) {
                    $min = $count;
                }
                if ($count > $max) {
                    $max = $count;
                }
                $html .= '[' . $i . ', ' . $count . '], ';
                $tickSeries[$j][] = $label;
            }
            $html = trim($html, ', ') . '];';
            $first = false;
            $j++;
        }
        foreach ($tickSeries as $key => $ticks) {
            $html .= $chartName . '_ticks_' . $key . ' = [';
            foreach ($ticks as $tick) {
                $html .= '\'' . $tick . '\',';
            }
            $html = trim($html, ',') . '];';
            $html .= '$(\'#' . $chartName . '\').bind(\'plothover\', function (event, pos, item) {handleTooltip(event, pos, item, ' . $chartName . '_ticks_' . $key . ', ' . $key . ');});';
        }

        $max = $max + 15 / 100 * $max;
        if ($min > 0) {
            $min = $min - 70 / 100 * $min;
        }
        $html .= 'var ' . $chartName . ' = $.plot($(\'#' . $chartName . '\'), [';
        $i = 0;
        foreach ($series as $chart) {
            $html .= '{data: ' . $chartName . '_' . str_replace('-', '_', $chart['object']) . '_' . $i . ', label: \'' . $chart['label'] . '\'}, ';
            $i++;
        }
        $html = trim($html, ', ') . '], ';
        $html .= '{
				series: {
				   ' . $type . ': { show: true },
				   points: { show: ' . $points . ' }
				},';
        $html .= 'legend: { margin: [0, 0], backgroundOpacity: 0 },';
        $html .= 'grid: { hoverable: true, clickable: true },
			yaxis: { min: ' . $min . ', max: ' . $max . ' },
			xaxis: {';
        $html .= 'ticks: [';
        $i = 0;
        if (isset($ticks)) {
            $div = round(count($ticks) * strlen($ticks[0]) / 60);
            if ($div < 1) {
                $div = 1;
            }
            if ($labels) {
                foreach ($tickSeries[0] as $tick) {
                    $i++;
                    if (($i - 1) % $div == 0) {
                        $html .= '[' . $i . ', \'' . $tick . '\'], ';
                    }
                }
            }
        }
        $html = trim($html, ', ') . ']';
        $html .= '}
			});';
        return $html . '});';
    }
206654
public function getCountryAccountsChartsTypes()
	{
    $accountsChartsTypes = array();

    $this->AccountChartType->accountsChartsTypesByCountry($this->AuthenticationManager->getCurrentUserOrganizationCountry())->each(function($AccountChartType) use(&$accountsChartsTypes)
    {
      $name = $this->Lang->has($AccountChartType->lang_key) ? $this->Lang->get($AccountChartType->lang_key) : $AccountChartType->name;
      array_push($accountsChartsTypes, array('id' => $AccountChartType->id, 'name' => $name, 'url' => $AccountChartType->url));
    });

    return $accountsChartsTypes;

	}
729134
function () {
		var series = this,
			yAxis = series.yAxis;

		seriesTypes.area.prototype.translate.apply(series);

		// Set plotLow and plotHigh
		each(series.points, function (point) {

			var low = point.low,
				high = point.high,
				plotY = point.plotY;

			if (high === null && low === null) {
				point.y = null;
			} else if (low === null) {
				point.plotLow = point.plotY = null;
				point.plotHigh = yAxis.translate(high, 0, 1, 0, 1);
			} else if (high === null) {
				point.plotLow = plotY;
				point.plotHigh = null;
			} else {
				point.plotLow = plotY;
				point.plotHigh = yAxis.translate(high, 0, 1, 0, 1);
			}
		});

		// Postprocess plotHigh
		if (this.chart.polar) {
			each(this.points, function (point) {
				series.highToXY(point);
			});
		}
	}
207388
private static function _chartDataSeriesValues($seriesValueSet,$dataType='n') {
		$seriesVal = array();
		$formatCode = '';
		$pointCount = 0;

		foreach($seriesValueSet as $seriesValueIdx => $seriesValue) {
			switch ($seriesValueIdx) {
				case 'ptCount':
					$pointCount = self::_getAttribute($seriesValue, 'val', 'integer');
					break;
				case 'formatCode':
					$formatCode = (string) $seriesValue;
					break;
				case 'pt':
					$pointVal = self::_getAttribute($seriesValue, 'idx', 'integer');
					if ($dataType == 's') {
						$seriesVal[$pointVal] = (string) $seriesValue->v;
					} else {
						$seriesVal[$pointVal] = (float) $seriesValue->v;
					}
					break;
			}
		}

		if (empty($seriesVal)) {
			$seriesVal = NULL;
		}

		return array( 'formatCode'	=> $formatCode,
					  'pointCount'	=> $pointCount,
					  'dataValues'	=> $seriesVal
					);
	}
1020795
public function getCellPrototype($row = NULL)
    {
        $td = parent::getCellPrototype($row);

        if ($this->isEditable() && $row !== NULL) {
            if (!in_array('editable', $td->class)) {
                $td->class[] = 'editable';
            }

            $value = $this->editableValueCallback === NULL
                ? $this->getValue($row)
                : call_user_func_array($this->editableValueCallback, [$row, $this]);

            $td->setAttribute('data-grido-editable-value', $value);
        }

        return $td;
    }
596767
public function getPlotSeriesCount() {
		$seriesCount = 0;
		foreach($this->_plotSeries as $plot) {
			$seriesCount += $plot->getPlotSeriesCount();
		}
		return $seriesCount;
	}
344644
private function deserializeArea(Area $area, array $data)
    {
        if (!empty($data['color'])) {
            $area->setColor($data['color']);
        }

        $area->setShape($data['shape']);

        switch ($data['shape']) {
            case 'circle':
                // legacy: the top left corner is stored, not the center
                $x = $data['center']['x'] - $data['radius'];
                $y = $data['center']['y'] - $data['radius'];
                $area->setValue("{$x},{$y}");
                $area->setSize($data['radius'] * 2);
                break;
            case 'rect':
                $area->setValue(sprintf(
                    '%s,%s,%s,%s',
                    $data['coords'][0]['x'],
                    $data['coords'][0]['y'],
                    $data['coords'][1]['x'],
                    $data['coords'][1]['y']
                ));
                $area->setSize($data['coords'][1]['x'] - $data['coords'][0]['x']);
                break;
        }
    }
42415
public function getSerieMedian($Serie)
    {
        if (isset($this->Data["Series"][$Serie])) {
            $SerieData = $this->stripVOID($this->Data["Series"][$Serie]["Data"]);
            sort($SerieData);
            $SerieCenter = floor(sizeof($SerieData) / 2);

            if (isset($SerieData[$SerieCenter])) {
                return $SerieData[$SerieCenter];
            }
        }
        return null;
    }
296777
def chart_type(cls, plot):
        
        try:
            chart_type_method = {
                'AreaPlot':     cls._differentiate_area_chart_type,
                'Area3DPlot':   cls._differentiate_area_3d_chart_type,
                'BarPlot':      cls._differentiate_bar_chart_type,
                'BubblePlot':   cls._differentiate_bubble_chart_type,
                'DoughnutPlot': cls._differentiate_doughnut_chart_type,
                'LinePlot':     cls._differentiate_line_chart_type,
                'PiePlot':      cls._differentiate_pie_chart_type,
                'RadarPlot':    cls._differentiate_radar_chart_type,
                'XyPlot':       cls._differentiate_xy_chart_type,
            }[plot.__class__.__name__]
        except KeyError:
            raise NotImplementedError(
                "chart_type() not implemented for %s" %
                plot.__class__.__name__
            )
        return chart_type_method(plot)
272151
public function getSerieAverage($Serie)
    {
        if (isset($this->Data["Series"][$Serie])) {
            $SerieData = $this->stripVOID($this->Data["Series"][$Serie]["Data"]);
            return array_sum($SerieData) / sizeof($SerieData);
        }

        return null;
    }
1058062
private function getType($name_area)
    {
        $type = $name_area->find('a', 0)->href;
        $type = explode('.php', $type);

        return substr($type[0], 1);
    }