Link two or more series together. This is done initially from Chart.render,
and after Chart.addSeries and Series.remove.
777924
function () {
		var chart = this,
			chartSeries = chart.series;

		// Reset links
		each(chartSeries, function (series) {
			series.linkedSeries.length = 0;
		});

		// Apply new links
		each(chartSeries, function (series) {
			var linkedTo = series.options.linkedTo;
			if (isString(linkedTo)) {
				if (linkedTo === ':previous') {
					linkedTo = chart.series[series.index - 1];
				} else {
					linkedTo = chart.get(linkedTo);
				}
				if (linkedTo) {
					linkedTo.linkedSeries.push(series);
					series.linkedParent = linkedTo;
				}
			}
		});
	}
116574
function () {
		var series = this,
			chart = series.chart;

		// column and bar series affects other series of the same type
		// as they are either stacked or grouped
		if (chart.hasRendered) {
			each(chart.series, function (otherSeries) {
				if (otherSeries.type === series.type) {
					otherSeries.isDirty = true;
				}
			});
		}

		Series.prototype.remove.apply(series, arguments);
	}
735752
public void addSeries( String seriesName, double[] x, double[] y ) {
        XYSeries series = new XYSeries(seriesName);
        for( int i = 0; i < x.length; i++ ) {
            series.add(x[i], y[i]);
        }
        dataset.addSeries(series);
    }
72649
def _add_chart_graphicFrame(self, rId, x, y, cx, cy):
        
        shape_id = self._next_shape_id
        name = 'Chart %d' % (shape_id-1)
        graphicFrame = CT_GraphicalObjectFrame.new_chart_graphicFrame(
            shape_id, name, rId, x, y, cx, cy
        )
        self._spTree.append(graphicFrame)
        return graphicFrame
1287598
def add_data_set(self, data, series_type="map", name=None, is_coordinate = False, **kwargs):
        
        
        self.data_set_count += 1
        if not name:
            name = "Series %d" % self.data_set_count
        kwargs.update({'name':name})

        if is_coordinate:
            self.data_is_coordinate = True
            self.add_JSsource('https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js')
            if self.map and not self.data_temp:
                series_data = Series([], series_type='map', **{'mapData': self.map})
                series_data.__options__().update(SeriesOptions(series_type='map', **{'mapData': self.map}).__options__())
                self.data_temp.append(series_data)

        if self.map and 'mapData' in kwargs.keys():
            kwargs.update({'mapData': self.map})

        series_data = Series(data, series_type=series_type, **kwargs)
       
        series_data.__options__().update(SeriesOptions(series_type=series_type, **kwargs).__options__())
        self.data_temp.append(series_data)
811827
private void addChartLinks() {
        this.add(new UpdateChartJsLink("LineChartBasic", ChartjsConfigurations.LINE_BASIC.toString()));
        this.add(new UpdateChartJsLink("BarChartVertical" , ChartjsConfigurations.BAR_VERTICAL.toString()));
        this.add(new UpdateChartJsLink("LineChartMultiAxis", ChartjsConfigurations.LINE_MULTI_AXIS.toString()));
        this.add(new UpdateChartJsLink("LineChartStepped", ChartjsConfigurations.LINE_STEPPED.toString()));
        this.add(new UpdateChartJsLink("LineChartInterpolated", ChartjsConfigurations.LINE_INTERPOLATED.toString()));
        this.add(new UpdateChartJsLink("LineStyles", ChartjsConfigurations.LINE_STYLES.toString()));
        this.add(new UpdateChartJsLink("PointStyles", ChartjsConfigurations.POINT_STYLES.toString()));
        this.add(new UpdateChartJsLink("PointSizes", ChartjsConfigurations.POINT_SIZES.toString()));
        this.add(new UpdateChartJsLink("BarChartHorizontal", ChartjsConfigurations.BAR_HORIZONTAL.toString()));
        this.add(new UpdateChartJsLink("BarChartStacked", ChartjsConfigurations.BAR_STACKED.toString()));
        this.add(new UpdateChartJsLink("BarChartStackedGroup", ChartjsConfigurations.BAR_STACKED_GROUP.toString()));
        this.add(new UpdateChartJsLink("BarChartMultiAxis", ChartjsConfigurations.BAR_MULTI_AXIS.toString()));
        this.add(new UpdateChartJsLink("PieChart", ChartjsConfigurations.PIE.toString()));
        this.add(new UpdateChartJsLink("AreaLineBoundariesChart", ChartjsConfigurations.AREA_LINE_BOUNDARIES.toString()));
        this.add(new UpdateChartJsLink("LineChartStacked", ChartjsConfigurations.LINE_STACKED.toString()));
        this.add(new UpdateChartJsLink("LineChartDataset", ChartjsConfigurations.LINE_DATASET.toString()));
        this.add(new UpdateChartJsLink("RadarChart", ChartjsConfigurations.RADAR.toString()));
        this.add(new UpdateChartJsLink("DoughnutChart", ChartjsConfigurations.DOUGHNUT.toString()));
        this.add(new UpdateChartJsLink("PolarAreaChart", ChartjsConfigurations.POLAR_AREA.toString()));
        this.add(new UpdateChartJsLink("ScatterChart", ChartjsConfigurations.SCATTER.toString()));
        this.add(new UpdateChartJsLink("ScatterChartMultiAxis", ChartjsConfigurations.SCATTER_MULTI_AXIS.toString()));
        this.add(new UpdateChartJsLink("ComboBarLineChart", ChartjsConfigurations.COMBO_BAR_LINE.toString()));
        this.add(new UpdateChartJsLink("LegendPosition", ChartjsConfigurations.LEGEND_POSITION.toString()));
        this.add(new UpdateChartJsLink("StepSize", ChartjsConfigurations.STEP_SIZE.toString()));
        this.add(new UpdateChartJsLink("MinMax", ChartjsConfigurations.MIN_MAX.toString()));
        this.add(new UpdateChartJsLink("GridLines", ChartjsConfigurations.GRID_LINES.toString()));
        this.add(new UpdateChartJsLink("MultilineLabels", ChartjsConfigurations.MULTILINE_LABELS.toString()));
        this.add(new UpdateChartJsLink("LogarithmicLineChart", ChartjsConfigurations.LINE_LOGARITHMIC.toString()));
        this.add(new UpdateChartJsLink("LogarithmicScatterChart", ChartjsConfigurations.SCATTER_LOGARITHMIC.toString()));
        this.add(new UpdateChartJsLink("BubbleChart", ChartjsConfigurations.BUBBLE.toString()));
        this.add(new UpdateChartJsLink("FilteringLabels", ChartjsConfigurations.FILTERING_LABELS.toString()));
        this.add(new UpdateChartJsLink("TimeLine", ChartjsConfigurations.TIME_LINE.toString()));
        this.add(new UpdateChartJsLink("NonNumeric", ChartjsConfigurations.NON_NUMERIC.toString()));
        this.add(new UpdateChartJsLink("TimePoint", ChartjsConfigurations.TIME_POINT.toString()));
        this.add(new UpdateChartJsLink("TimeSeries", ChartjsConfigurations.TIME_SERIES.toString()));
        this.add(new UpdateChartJsLink("TimeCombo", ChartjsConfigurations.TIME_COMBO.toString()));
        this.add(new UpdateChartJsLink("OtherRadar", ChartjsConfigurations.RADAR_2.toString()));
        this.add(new UpdateChartJsLink("Tooltip", ChartjsConfigurations.TOOLTIP.toString()));
        this.add(new UpdateChartJsLink("TooltipHtml", ChartjsConfigurations.TOOLTIP_HTML.toString()));
        this.add(new UpdateChartJsLink("LegendPointStyle", ChartjsConfigurations.LEGEND_POINT_STYLE.toString()));
        this.add(new UpdateChartJsLink("LineChartProgressBar", ChartjsConfigurations.LINE_PROGRESS_BAR.toString()));
        this.add(new UpdateChartJsLink("DataLabellingChart", ChartjsConfigurations.DATA_LABELLING.toString()));
        this.add(new UpdateChartJsLink("TooltipInteractions", ChartjsConfigurations.TOOLTIP_INTERACTIONS.toString()));
    }
625832
def add_series(series)
      raise ArgumentError, "Invalid argument 'series'. Expected Series, got #{series.class}." unless series.is_a?(Series)
      # Do not add it again if the series already belongs to this instance:
      @series << series unless @associated_series[series.uid]
      @image_series << series if series.is_a?(ImageSeries) && !@associated_series[series.uid]
      @associated_series[series.uid] = series
      @associated_iseries[series.uid] = series if series.is_a?(ImageSeries)
    end
1151061
public CategorySeries addSeries(
      String seriesName,
      List<?> xData,
      List<? extends Number> yData,
      List<? extends Number> errorBars) {

    // Sanity checks
    sanityCheck(seriesName, xData, yData, errorBars);

    CategorySeries series;
    if (xData != null) {

      // Sanity check
      if (xData.size() != yData.size()) {
        throw new IllegalArgumentException("X and Y-Axis sizes are not the same!!!");
      }

      series = new CategorySeries(seriesName, xData, yData, errorBars, getDataType(xData));
    } else { // generate xData
      xData = Utils.getGeneratedDataAsList(yData.size());
      series = new CategorySeries(seriesName, xData, yData, errorBars, getDataType(xData));
    }

    seriesMap.put(seriesName, series);

    return series;
  }
722635
function () {
		var chart = this.chart,
			sharedClipKey = this.sharedClipKey,
			group = this.group;
			
		if (group && this.options.clip !== false) {
			group.clip(chart.clipRect);
			this.markerGroup.clip(); // no clip
		}
		
		// Remove the shared clipping rectancgle when all series are shown		
		setTimeout(function () {
			if (sharedClipKey && chart[sharedClipKey]) {
				chart[sharedClipKey] = chart[sharedClipKey].destroy();
				chart[sharedClipKey + 'm'] = chart[sharedClipKey + 'm'].destroy();
			}
		}, 100);
	}
401124
public BubbleSeries addSeries(
      String seriesName, double[] xData, double[] yData, double[] bubbleData) {

    // Sanity checks
    sanityCheck(seriesName, xData, yData, bubbleData);

    BubbleSeries series;
    if (xData != null) {

      // Sanity check
      if (xData.length != yData.length) {
        throw new IllegalArgumentException("X and Y-Axis sizes are not the same!!!");
      }

      series = new BubbleSeries(seriesName, xData, yData, bubbleData);
    } else { // generate xData
      series =
          new BubbleSeries(
              seriesName, Utils.getGeneratedDataAsArray(yData.length), yData, bubbleData);
    }

    seriesMap.put(seriesName, series);

    return series;
  }
1152034
function (vis, redraw) {
		var series = this,
			chart = series.chart,
			legendItem = series.legendItem,
			showOrHide,
			ignoreHiddenSeries = chart.options.chart.ignoreHiddenSeries,
			oldVisibility = series.visible;

		// if called without an argument, toggle visibility
		series.visible = vis = series.userOptions.visible = vis === UNDEFINED ? !oldVisibility : vis;
		showOrHide = vis ? 'show' : 'hide';

		// show or hide elements
		each(['group', 'dataLabelsGroup', 'markerGroup', 'tracker'], function (key) {
			if (series[key]) {
				series[key][showOrHide]();
			}
		});

		
		// hide tooltip (#1361)
		if (chart.hoverSeries === series) {
			series.onMouseOut();
		}


		if (legendItem) {
			chart.legend.colorizeItem(series, vis);
		}


		// rescale or adapt to resized chart
		series.isDirty = true;
		// in a stack, all other series are affected
		if (series.options.stacking) {
			each(chart.series, function (otherSeries) {
				if (otherSeries.options.stacking && otherSeries.visible) {
					otherSeries.isDirty = true;
				}
			});
		}

		// show or hide linked series
		each(series.linkedSeries, function (otherSeries) {
			otherSeries.setVisible(vis, false);
		});

		if (ignoreHiddenSeries) {
			chart.isDirtyBox = true;
		}
		if (redraw !== false) {
			chart.redraw();
		}

		fireEvent(series, showOrHide);
	}
984759
function () {
		var series = this,
			chart = series.chart,
			pointer = chart.pointer,
			cursor = series.options.cursor,
			css = cursor && { cursor: cursor },
			onMouseOver = function (e) {
				var target = e.target,
					point;

				if (chart.hoverSeries !== series) {
					series.onMouseOver();
				}
				while (target && !point) {
					point = target.point;
					target = target.parentNode;
				}
				if (point !== UNDEFINED && point !== chart.hoverPoint) { // undefined on graph in scatterchart
					point.onMouseOver(e);
				}
			};

		// Add reference to the point
		each(series.points, function (point) {
			if (point.graphic) {
				point.graphic.element.point = point;
			}
			if (point.dataLabel) {
				point.dataLabel.element.point = point;
			}
		});

		// Add the event listeners, we need to do this only once
		if (!series._hasTracking) {
			each(series.trackerGroups, function (key) {
				if (series[key]) { // we don't always have dataLabelsGroup
					series[key]
						.addClass(PREFIX + 'tracker')
						.on('mouseover', onMouseOver)
						.on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })
						.css(css);
					if (hasTouch) {
						series[key].on('touchstart', onMouseOver);
					}
				}
			});
			series._hasTracking = true;
		}
	}
886970
private void addCharts(PageParameters parameters){

        List<Chart> charts = getChartFromParams(parameters);

        //If we have more than one chart - use SmallComponents
        if(charts.size() > 1){
            List<SmallChartComponent> components = new ArrayList<>();
            for(Chart i : charts){
                components.add(new SmallChartComponent(i));
            }
            add( new ListView<SmallChartComponent>( "components", components ){
                protected void populateItem(ListItem item)
                {
                    item.add( (SmallChartComponent)item.getModelObject() );
                }
            });
        }else { //else use the regular full-width chart component
            List<ChartComponent> components = new ArrayList<>();
            for (Chart i : charts) {
                components.add(new ChartComponent(i));
            }
            add( new ListView<ChartComponent>( "components", components ){
                protected void populateItem(ListItem item)
                {
                    item.add( (ChartComponent)item.getModelObject() );
                }
            });
        }

        //Add Code Components
        List<CodeComponent> code_components = new ArrayList<>();
        for(Chart i : charts){
            code_components.add(new CodeComponent(i));
        }
        add( new ListView<CodeComponent>( "code_components", code_components ){
            protected void populateItem(ListItem item){
                item.add( (CodeComponent)item.getModelObject() );
            }
        });
    }
209964
def _multiseries(self, col, x, y, ctype, rsum, rmean):
		
		self.autoprint = False
		x, y = self._check_fields(x, y)
		chart = None
		series = self.split_(col)
		for key in series:
			instance = series[key]
			if rsum is not None:
				instance.rsum(rsum, index_col=x)
			if rmean is not None:
				instance.rmean(rmean, index_col=x)
			instance.chart(x, y)
			self.scolor()
			c = None
			label = str(key)
			if ctype == "point":
				c = instance.point_(label)
			if ctype == "line":
				instance.zero_nan(y)
				c = instance.line_(label)
			if ctype == "bar":
				c = instance.bar_(label)
			if ctype == "area":
				c = instance.area_(label)
			if c is None:
				self.warning("Chart type " + ctype + 
							 " not supported, aborting")
				return
			if chart is None:
				chart = c
			else:
				chart = chart * c
		return chart
1271966
function () {
            var chart = this,
              axes = chart.axes,
              renderer = chart.renderer,
              options = chart.options;

            // Title
            chart.setTitle();


            // Legend
            chart.legend = new Legend(chart, options.legend);

            chart.getStacks(); // render stacks

            // Get margins by pre-rendering axes
            // set axes scales
            each(axes, function (axis) {
                axis.setScale();
            });

            chart.getMargins();

            chart.maxTicks = null; // reset for second pass
            each(axes, function (axis) {
                axis.setTickPositions(true); // update to reflect the new margins
                axis.setMaxTicks();
            });
            chart.adjustTickAmounts();
            chart.getMargins(); // second pass to check for new labels


            // Draw the borders and backgrounds
            chart.drawChartBox();


            // Axes
            if (chart.hasCartesianSeries) {
                each(axes, function (axis) {
                    axis.render();
                });
            }

            // The series
            if (!chart.seriesGroup) {
                chart.seriesGroup = renderer.g('series-group')
                  .attr({ zIndex: 3 })
                  .add();
            }
            chart.renderSeries();

            // Labels
            chart.renderLabels();

            // Credits
            chart.showCredits(options.credits);

            // Set flag
            chart.hasRendered = true;

        }
701593
function(data){
    var _self = this,
      series = _self.getSeries(),
      fields = _self.get('fields');

    _self.set('data',data);

    Util.each(series,function(item,index){
      if(fields){
        var arr = _self._getSeriesData(item.get('name'),index);
        item.changeData(arr);
      }else{
        if(Util.isArray(data[0])){
          item.changeData(data[index]);
        }else{
          item.changeData(data);
        }
      }
    });
    _self.repaint();
  }
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
						});
				}
			});
		}
	}