Adiciona uma serie

@param serie Add serie of chart
@return AbstractChart
16517
public AbstractChart<T, S> addSerie(Serie serie) {
		Collection<Serie> series = getSeries();
		if (series == null) {
			series = new ArrayList<Serie>();
		}
		series.add(serie);
		return this;
	}
273342
public function getHarmonicMean($Serie)
    {
        if (isset($this->Data["Series"][$Serie])) {
            $SerieData = $this->stripVOID($this->Data["Series"][$Serie]["Data"]);
            $Seriesum = 0;
            foreach ($SerieData as $Value) {
                $Seriesum = $Seriesum + 1 / $Value;
            }
            return sizeof($SerieData) / $Seriesum;
        }

        return null;
    }
1082864
protected function renderSeries(SeriesInterface $series)
    {
        if ($series instanceof AreaSeriesInterface) {
            $type = 'area';
        } elseif ($series instanceof AreaSplineSeriesInterface) {
            $type = 'areaspline';
        } elseif ($series instanceof BarSeriesInterface) {
            $type = 'bar';
        } elseif ($series instanceof ColumnSeriesInterface) {
            $type = 'column';
        } elseif ($series instanceof LineSeriesInterface) {
            $type = 'line';
        } elseif ($series instanceof PieSeriesInterface) {
            $type = 'pie';
        } elseif ($series instanceof ScatterSeriesInterface) {
            $type = 'scatter';
        } elseif ($series instanceof SplineSeriesInterface) {
            $type = 'spline';
        } else {
            throw new UnexpectedValueException();
        }

        $options['type'] = $type;

        if (null !== $series->getName()) {
            $options['name'] = $series->getName();
        }
        if (null !== $series->getColor()) {
            $options['color'] = $series->getColor();
        }
        if (null !== $series->getXAxis()) {
            $options['xAxis'] = $series->getXAxis();
        }
        if (null !== $series->getYAxis()) {
            $options['yAxis'] = $series->getYAxis();
        }

        foreach ($series->getDataPoints() as $dataPoint) {
            $options['data'][] = $this->renderDataPoint($dataPoint);
        }
        if (null !== $series->getLabelsFormatter()) {
            $options['dataLabels']['formatter'] = $series->getLabelsFormatter();
        }

        $options['marker'] = $this->renderMarker($series->getMarker());
        $options['enableMouseTracking'] = $series->isEnableMouseTracking();

        if (null !== $series->getCursor()) {
            $options['cursor'] = $series->getCursor();
        }

        if ($series instanceof SequentialSeriesInterface) {
            $options['pointStart'] = $series->getPointStart();
        }
        if ($series instanceof StackableSeriesInterface) {
            if (true === $series->isStacking()) {
                if (true === $series->isPercentageStacking()) {
                    $options['stacking'] = 'percent';
                } else {
                    $options['stacking'] = 'normal';
                }
            }
        }

        $events = array();

        if (null !== $series->getCheckboxClickEvent()) {
            $events['checkboxClick'] = $series->getCheckboxClickEvent();
        }
        if (null !== $series->getClickEvent()) {
            $events['click'] = $series->getClickEvent();
        }
        if (null !== $series->getHideEvent()) {
            $events['hide'] = $series->getHideEvent();
        }
        if (null !== $series->getLegendItemClickEvent()) {
            $events['legendItemClick'] = $series->getLegendItemClickEvent();
        }
        if (null !== $series->getMouseOutEvent()) {
            $events['mouseOut'] = $series->getMouseOutEvent();
        }
        if (null !== $series->getMouseOverEvent()) {
            $events['mouseOver'] = $series->getMouseOverEvent();
        }
        if (null !== $series->getShowEvent()) {
            $events['show'] = $series->getShowEvent();
        }

        if (count($events) > 0) {
            $options['events'] = $events;
        }

        if (false === $series->getAnimation()->isEnabled()) {
            $options['animation'] = false;
        } else {
            $animation = array();

            if (null !== $series->getAnimation()->getDuration()) {
                $animation['duration'] = $series->getAnimation()->getDuration();
            }
            if (null !== $series->getAnimation()->getEasing()) {
                $animation['easing'] = $series->getAnimation()->getEasing();
            }

            if (count($animation) > 0) {
                $options['animation'] = $animation;
            }
        }

        if ($series instanceof PieSeriesInterface) {
            if (null !== $series->getXPosition() && null !== $series->getYPosition()) {
                $xPosition = true === $series->isXPositionAPercentage() ?
                    $series->getXPosition() . '%' :
                    $series->getXPosition();
                $yPosition = true === $series->isYPositionAPercentage() ?
                    $series->getYPosition() . '%' :
                    $series->getYPosition();
                $options['center'] = array($xPosition, $yPosition);
            }

            if (null !== $series->getSize()) {
                $options['size'] = true === $series->isSizeAPercentage() ?
                    $series->getSize() . '%' :
                    $series->getSize();
            }

            $options['dataLabels']['distance'] = $series->getLabelsDistance();
        }

        $hoverState = array(
            'enabled' => $series->getHoverState()->isEnabled(),
            'marker' => $this->renderMarker($series->getHoverState()->getMarker()),
        );

        if (null !== $series->getHoverState()->getLineWidth()) {
            $hoverState['lineWidth'] = $series->getHoverState()->getLineWidth();
        }
        if (
            true === $series->getHoverState() instanceof SolidHoverStateInterface &&
            null !== $series->getHoverState()->getBrightness()
        ) {
            $hoverState['brightness'] = $series->getHoverState()->getBrightness();
        }

        $options['states']['hover'] = $hoverState;

        return $options;
    }
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;
    }
1212909
def _format(self, serie, i):
        """"""
        value = serie.values[i]
        metadata = serie.metadata.get(i)

        kwargs = {'chart': self, 'serie': serie, 'index': i}
        formatter = ((metadata and metadata.get('formatter'))
                     or serie.formatter or self.formatter
                     or self._value_format)
        kwargs = filter_kwargs(formatter, kwargs)
        return formatter(value, **kwargs)
712294
function () {
		if (this.options.dataLabels.enabled) {
			var series = this,
				x,
				y,
				data = series.data,
				seriesOptions = series.options,
				options = seriesOptions.dataLabels,
				str,
				dataLabelsGroup = series.dataLabelsGroup,
				chart = series.chart,
				renderer = chart.renderer,
				inverted = chart.inverted,
				seriesType = series.type,
				color,
				stacking = seriesOptions.stacking,
				isBarLike = seriesType === 'column' || seriesType === 'bar',
				vAlignIsNull = options.verticalAlign === null,
				yIsNull = options.y === null;

			if (isBarLike) {
				if (stacking) {
					// In stacked series the default label placement is inside the bars
					if (vAlignIsNull) {
						options = merge(options, {verticalAlign: 'middle'});
					}

					// If no y delta is specified, try to create a good default
					if (yIsNull) {
						options = merge(options, {y: {top: 14, middle: 4, bottom: -6}[options.verticalAlign]});
					}
				} else {
					// In non stacked series the default label placement is on top of the bars
					if (vAlignIsNull) {
						options = merge(options, {verticalAlign: 'top'});
					}
				}
			}

			// create a separate group for the data labels to avoid rotation
			if (!dataLabelsGroup) {
				dataLabelsGroup = series.dataLabelsGroup =
					renderer.g('data-labels')
						.attr({
							visibility: series.visible ? VISIBLE : HIDDEN,
							zIndex: 6
						})
						.translate(chart.plotLeft, chart.plotTop)
						.add();
			} else {
				dataLabelsGroup.translate(chart.plotLeft, chart.plotTop);
			}

			// determine the color
			color = options.color;
			if (color === 'auto') { // 1.0 backwards compatibility
				color = null;
			}
			options.style.color = pick(color, series.color, 'black');

			// make the labels for each point
			each(data, function (point) {
				var barX = point.barX,
					plotX = (barX && barX + point.barW / 2) || point.plotX || -999,
					plotY = pick(point.plotY, -999),
					dataLabel = point.dataLabel,
					align = options.align,
					individualYDelta = yIsNull ? (point.y >= 0 ? -6 : 12) : options.y;

				// get the string
				str = options.formatter.call(point.getLabelConfig());
				x = (inverted ? chart.plotWidth - plotY : plotX) + options.x;
				y = (inverted ? chart.plotHeight - plotX : plotY) + individualYDelta;

				// in columns, align the string to the column
				if (seriesType === 'column') {
					x += { left: -1, right: 1 }[align] * point.barW / 2 || 0;
				}

				if (inverted && point.y < 0) {
					align = 'right';
					x -= 10;
				}

				// update existing label
				if (dataLabel) {
					// vertically centered
					if (inverted && !options.y) {
						y = y + pInt(dataLabel.styles.lineHeight) * 0.9 - dataLabel.getBBox().height / 2;
					}
					dataLabel
						.attr({
							text: str
						}).animate({
							x: x,
							y: y
						});
				// create new label
				} else if (defined(str)) {
					dataLabel = point.dataLabel = renderer.text(
						str,
						x,
						y
					)
					.attr({
						align: align,
						rotation: options.rotation,
						zIndex: 1
					})
					.css(options.style)
					.add(dataLabelsGroup);
					// vertically centered
					if (inverted && !options.y) {
						dataLabel.attr({
							y: y + pInt(dataLabel.styles.lineHeight) * 0.9 - dataLabel.getBBox().height / 2
						});
					}
				}


				/*if (series.isCartesian) {
					dataLabel[chart.isInsidePlot(plotX, plotY) ? 'show' : 'hide']();
				}*/

				if (isBarLike && seriesOptions.stacking && dataLabel) {
					var barY = point.barY,
						barW = point.barW,
						barH = point.barH;

					dataLabel.align(options, null,
						{
							x: inverted ? chart.plotWidth - barY - barH : barX,
							y: inverted ? chart.plotHeight - barX - barW : barY,
							width: inverted ? barH : barW,
							height: inverted ? barW : barH
						});
				}
			});
		}
	}
1136131
function () {
		var chartOptions = this.chartOptions,
			options = this.options,
			xColumns = [],
			getValueCount = function (type) {
				return (Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap || [0]).length;
			},
			getPointArrayMap = function (type) {
				return Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap;
			},
			globalType = chartOptions && chartOptions.chart && chartOptions.chart.type,
			individualCounts = [],
			seriesBuilders = [],
			seriesIndex = 0,
			i;

		each((chartOptions && chartOptions.series) || [], function (series) {
			individualCounts.push(getValueCount(series.type || globalType));
		});

		// Collect the x-column indexes from seriesMapping
		each((options && options.seriesMapping) || [], function (mapping) {
			xColumns.push(mapping.x || 0);
		});

		// If there are no defined series with x-columns, use the first column as x column
		if (xColumns.length === 0) {
			xColumns.push(0);
		}

		// Loop all seriesMappings and constructs SeriesBuilders from
		// the mapping options.
		each((options && options.seriesMapping) || [], function (mapping) {
			var builder = new SeriesBuilder(),
				name,
				numberOfValueColumnsNeeded = individualCounts[seriesIndex] || getValueCount(globalType),
				seriesArr = (chartOptions && chartOptions.series) || [],
				series = seriesArr[seriesIndex] || {},
				pointArrayMap = getPointArrayMap(series.type || globalType) || ['y'];

			// Add an x reader from the x property or from an undefined column
			// if the property is not set. It will then be auto populated later.
			builder.addColumnReader(mapping.x, 'x');

			// Add all column mappings
			for (name in mapping) {
				if (mapping.hasOwnProperty(name) && name !== 'x') {
					builder.addColumnReader(mapping[name], name);
				}
			}

			// Add missing columns
			for (i = 0; i < numberOfValueColumnsNeeded; i++) {
				if (!builder.hasReader(pointArrayMap[i])) {
					//builder.addNextColumnReader(pointArrayMap[i]);
					// Create and add a column reader for the next free column index
					builder.addColumnReader(undefined, pointArrayMap[i]);
				}
			}

			seriesBuilders.push(builder);
			seriesIndex++;
		});

		var globalPointArrayMap = getPointArrayMap(globalType);
		if (globalPointArrayMap === undefined) {
			globalPointArrayMap = ['y'];
		}

		this.valueCount = {
			global: getValueCount(globalType),
			xColumns: xColumns,
			individual: individualCounts,
			seriesBuilders: seriesBuilders,
			globalPointArrayMap: globalPointArrayMap
		};
	}
1115953
public Series<D> addPoint(final D point) {
		if (this.data == null) {
			this.data = new ArrayList<D>();
		}
		this.data.add(point);
		return this;
	}
1014433
def _SeriesFactory(ser):
    
    xChart_tag = ser.getparent().tag

    try:
        SeriesCls = {
            qn('c:areaChart'):     AreaSeries,
            qn('c:barChart'):      BarSeries,
            qn('c:bubbleChart'):   BubbleSeries,
            qn('c:doughnutChart'): PieSeries,
            qn('c:lineChart'):     LineSeries,
            qn('c:pieChart'):      PieSeries,
            qn('c:radarChart'):    RadarSeries,
            qn('c:scatterChart'):  XySeries,
        }[xChart_tag]
    except KeyError:
        raise NotImplementedError(
            'series class for %s not yet implemented' % xChart_tag
        )

    return SeriesCls(ser)
817004
function () {
		var axis = this,
			chart = this.chart,
			legendItems = this.legendItems,
			legendOptions = chart.options.legend,
			valueDecimals = legendOptions.valueDecimals,
			valueSuffix = legendOptions.valueSuffix || '',
			name;

		if (!legendItems.length) {
			each(this.dataClasses, function (dataClass, i) {
				var vis = true,
					from = dataClass.from,
					to = dataClass.to;
				
				// Assemble the default name. This can be overridden by legend.options.labelFormatter
				name = '';
				if (from === UNDEFINED) {
					name = '< ';
				} else if (to === UNDEFINED) {
					name = '> ';
				}
				if (from !== UNDEFINED) {
					name += Highcharts.numberFormat(from, valueDecimals) + valueSuffix;
				}
				if (from !== UNDEFINED && to !== UNDEFINED) {
					name += ' - ';
				}
				if (to !== UNDEFINED) {
					name += Highcharts.numberFormat(to, valueDecimals) + valueSuffix;
				}
				
				// Add a mock object to the legend items
				legendItems.push(extend({
					chart: chart,
					name: name,
					options: {},
					drawLegendSymbol: LegendSymbolMixin.drawRectangle,
					visible: true,
					setState: noop,
					setVisible: function () {
						vis = this.visible = !vis;
						each(axis.series, function (series) {
							each(series.points, function (point) {
								if (point.dataClass === i) {
									point.setVisible(vis);
								}
							});
						});
						
						chart.legend.colorizeItem(this, vis);
					}
				}, dataClass));
			});
		}
		return legendItems;
	}
907354
private static function _chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker = null, $smoothLine = false) {
		if (isset($seriesDetail->strRef)) {
			$seriesSource = (string) $seriesDetail->strRef->f;
			$seriesData = self::_chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']),'s');

			return new PHPExcel_Chart_DataSeriesValues('String',$seriesSource,$seriesData['formatCode'],$seriesData['pointCount'],$seriesData['dataValues'],$marker,$smoothLine);
		} elseif (isset($seriesDetail->numRef)) {
			$seriesSource = (string) $seriesDetail->numRef->f;
			$seriesData = self::_chartDataSeriesValues($seriesDetail->numRef->numCache->children($namespacesChartMeta['c']));

			return new PHPExcel_Chart_DataSeriesValues('Number',$seriesSource,$seriesData['formatCode'],$seriesData['pointCount'],$seriesData['dataValues'],$marker,$smoothLine);
		} elseif (isset($seriesDetail->multiLvlStrRef)) {
			$seriesSource = (string) $seriesDetail->multiLvlStrRef->f;
			$seriesData = self::_chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']),'s');
			$seriesData['pointCount'] = count($seriesData['dataValues']);

			return new PHPExcel_Chart_DataSeriesValues('String',$seriesSource,$seriesData['formatCode'],$seriesData['pointCount'],$seriesData['dataValues'],$marker,$smoothLine);
		} elseif (isset($seriesDetail->multiLvlNumRef)) {
			$seriesSource = (string) $seriesDetail->multiLvlNumRef->f;
			$seriesData = self::_chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']),'s');
			$seriesData['pointCount'] = count($seriesData['dataValues']);

			return new PHPExcel_Chart_DataSeriesValues('String',$seriesSource,$seriesData['formatCode'],$seriesData['pointCount'],$seriesData['dataValues'],$marker,$smoothLine);
		}
		return null;
	}
512840
public function getStandardDeviation($Serie)
    {
        if (isset($this->Data["Series"][$Serie])) {
            $Average = $this->getSerieAverage($Serie);
            $SerieData = $this->stripVOID($this->Data["Series"][$Serie]["Data"]);

            $DeviationSum = 0;
            foreach ($SerieData as $Key => $Value) {
                $DeviationSum = $DeviationSum + ($Value - $Average) * ($Value - $Average);
            }
            return sqrt($DeviationSum / count($SerieData));
        }
        return null;
    }
471942
public function useSeriesLabels( $series )
    {
        $this->useLabels = true;
        return $this->setNestedOptVal( $this->options, 'seriesStorage', $this->getSeriesTitle( $series ), 'pointLabels', 'edgeTolerance', 3 );
    }
322820
public function countDrawableSeries()
    {
        $count = 0;
        $Data = $this->DataSet->getData();

        foreach ($Data["Series"] as $SerieName => $Serie) {
            if ($Serie["isDrawable"] == true && $SerieName != $Data["Abscissa"]) {
                $count++;
            }
        }

        return $count;
    }
625491
public function useSeriesLabels( $series )
    {
        if ( !in_array( 'jqplot.pointLabels.js', $this->files ) ) {
            $this->files[] = 'jqplot.pointLabels.js';
        }
        $seriesTitle = $this->getSeriesTitle( $series );
        return $this->setNestedOptVal( $this->options, 'seriesStorage', $seriesTitle, 'pointLabels', 'show', true )
                    ->setNestedOptVal( $this->options, 'seriesStorage', $seriesTitle, 'pointLabels', 'edgeTolerance', 3 );
    }
312957
function (options) {
		var chart = this,
			optionsChart = chart.options.chart,
			type = options.type || optionsChart.type || optionsChart.defaultSeriesType,
			series,
			constr = seriesTypes[type];

		// No such series type
		if (!constr) {
			error(17, true);
		}

		series = new constr();
		series.init(this, options);
		return series;
	}
1183409
public function setSeries($series = null)
    {
        $this->series = $series;
        if ($series) {
            $series->addStream($this);
        }
        return $this;
    }