Draw center circle with text if {@link PieChartData#hasCenterCircle()} is set true.
545045
private void drawCenterCircle(Canvas canvas) {
        final PieChartData data = dataProvider.getPieChartData();
        final float circleRadius = originCircleOval.width() / 2f;
        final float centerRadius = circleRadius * data.getCenterCircleScale();
        final float centerX = originCircleOval.centerX();
        final float centerY = originCircleOval.centerY();

        canvas.drawCircle(centerX, centerY, centerRadius, centerCirclePaint);

        // Draw center text1 and text2 if not empty.
        if (!TextUtils.isEmpty(data.getCenterText1())) {

            final int text1Height = Math.abs(centerCircleText1FontMetrics.ascent);

            if (!TextUtils.isEmpty(data.getCenterText2())) {
                // Draw text 2 only if text 1 is not empty.
                final int text2Height = Math.abs(centerCircleText2FontMetrics.ascent);
                canvas.drawText(data.getCenterText1(), centerX, centerY - text1Height * 0.2f, centerCircleText1Paint);
                canvas.drawText(data.getCenterText2(), centerX, centerY + text2Height, centerCircleText2Paint);
            } else {
                canvas.drawText(data.getCenterText1(), centerX, centerY + text1Height / 4, centerCircleText1Paint);
            }
        }
    }
1238685
public void drawCircles( double[][][] houghValues, byte[] circlespixels ) {

        // Copy original input pixels into output
        // circle location display image and
        // combine with saturation at 100
        int roiaddr = 0;
        for( int y = offy; y < offy + height; y++ ) {
            for( int x = offx; x < offx + width; x++ ) {
                // Copy;
                circlespixels[roiaddr] = imageValues[x + offset * y];
                // Saturate
                if (circlespixels[roiaddr] != 0)
                    circlespixels[roiaddr] = 100;
                else
                    circlespixels[roiaddr] = 0;
                roiaddr++;
            }
        }
        // Copy original image to the circlespixels image.
        // Changing pixels values to 100, so that the marked
        // circles appears more clear. Must be improved in
        // the future to show the resuls in a colored image.
        // for(int i = 0; i < width*height ;++i ) {
        // if(imageValues[i] != 0 )
        // if(circlespixels[i] != 0 )
        // circlespixels[i] = 100;
        // else
        // circlespixels[i] = 0;
        // }
        // if (centerPoints == null) {
        // if (useThreshold)
        // getCenterPointsByThreshold(threshold);
        // else
        Coordinate[] centerPoints = getCenterPoints(houghValues, maxCircles);
        // }
        byte cor = -1;
        // Redefine these so refer to ROI coordinates exclusively
        int offset = width;
        int offx = 0;
        int offy = 0;

        for( int l = 0; l < maxCircles; l++ ) {
            int i = (int) centerPoints[l].x;
            int j = (int) centerPoints[l].y;
            // Draw a gray cross marking the center of each circle.
            for( int k = -10; k <= 10; ++k ) {
                int p = (j + k + offy) * offset + (i + offx);
                if (!outOfBounds(j + k + offy, i + offx))
                    circlespixels[(j + k + offy) * offset + (i + offx)] = cor;
                if (!outOfBounds(j + offy, i + k + offx))
                    circlespixels[(j + offy) * offset + (i + k + offx)] = cor;
            }
            for( int k = -2; k <= 2; ++k ) {
                if (!outOfBounds(j - 2 + offy, i + k + offx))
                    circlespixels[(j - 2 + offy) * offset + (i + k + offx)] = cor;
                if (!outOfBounds(j + 2 + offy, i + k + offx))
                    circlespixels[(j + 2 + offy) * offset + (i + k + offx)] = cor;
                if (!outOfBounds(j + k + offy, i - 2 + offx))
                    circlespixels[(j + k + offy) * offset + (i - 2 + offx)] = cor;
                if (!outOfBounds(j + k + offy, i + 2 + offx))
                    circlespixels[(j + k + offy) * offset + (i + 2 + offx)] = cor;
            }
        }
    }
578370
@Override
	public void setCenter(double cx, double cy, double cz) {
		this.center.set(cx, cy, cz);
	}
1033086
def center_image(self, no_reset=True):
        
        try:
            xy_mn, xy_mx = self.get_limits()
            data_x = float(xy_mn[0] + xy_mx[0]) / 2.0
            data_y = float(xy_mn[1] + xy_mx[1]) / 2.0

        except ImageViewNoDataError:
            # No data, so try to get center of any plotted objects
            canvas = self.get_canvas()
            try:
                data_x, data_y = canvas.get_center_pt()[:2]

            except Exception as e:
                self.logger.error("Can't compute center point: %s" % (str(e)))
                return

        self.panset_xy(data_x, data_y, no_reset=no_reset)

        if self.t_['autocenter'] == 'once':
            self.t_.set(autocenter='off')
358739
function drawLegend(obj) {
            if (obj.data) {

                svg.select('.donut-text')
                    .text(() => centeredTextFunction(obj.data))
                    .attr('dy', '.2em')
                    .attr('text-anchor', 'middle');

                svg.select('.donut-text').call(wrapText, legendWidth);
            }
        }
465973
function (point, mouseEvent) {
            var tooltip = this,
              chart = tooltip.chart,
              label = tooltip.label,
              options = tooltip.options,
              x,
              y,
              anchor,
              textConfig = {},
              text,
              pointConfig = [],
              formatter = options.formatter || tooltip.defaultFormatter,
              hoverPoints = chart.hoverPoints,
              borderColor,
              shared = tooltip.shared,
              currentSeries;

            clearTimeout(this.hideTimer);

            // get the reference point coordinates (pie charts use tooltipPos)
            tooltip.followPointer = splat(point)[0].series.tooltipOptions.followPointer;
            anchor = tooltip.getAnchor(point, mouseEvent);
            x = anchor[0];
            y = anchor[1];

            // shared tooltip, array is sent over
            if (shared && !(point.series && point.series.noSharedTooltip)) {

                // hide previous hoverPoints and set new

                chart.hoverPoints = point;
                if (hoverPoints) {
                    each(hoverPoints, function (point) {
                        point.setState();
                    });
                }

                each(point, function (item) {
                    item.setState(HOVER_STATE);

                    pointConfig.push(item.getLabelConfig());
                });

                textConfig = {
                    x: point[0].category,
                    y: point[0].y
                };
                textConfig.points = pointConfig;
                this.len = pointConfig.length;
                point = point[0];

                // single point tooltip
            } else {
                textConfig = point.getLabelConfig();
            }
            text = formatter.call(textConfig, tooltip);

            // register the current series
            currentSeries = point.series;
            this.distance = pick(currentSeries.tooltipOptions.distance, 16);

            // update the inner HTML
            if (text === false) {
                this.hide();
            } else {

                // show it
                if (tooltip.isHidden) {
                    stop(label);
                    label.attr('opacity', 1).show();
                }

                // update text
                label.attr({
                    text: text
                });

                // set the stroke color of the box
                borderColor = options.borderColor || point.color || currentSeries.color || '#606060';
                label.attr({
                    stroke: borderColor
                });

                tooltip.updatePosition({ plotX: x, plotY: y, negative: point.negative, ttBelow: point.ttBelow });

                this.isHidden = false;
            }
            fireEvent(chart, 'tooltipRefresh', {
                text: text,
                x: x + chart.plotLeft,
                y: y + chart.plotTop,
                borderColor: borderColor
            });
        }
1296159
public static void fillCircle(Graphics g, Point center, int diameter){
		fillCircle(g, (int) center.getX(), (int) center.getY(), diameter);
	}
1271287
@Override
	public void set(Point3D center, double radius1) {
		this.cx = center.getX();
		this.cy = center.getY();
		this.cz = center.getZ();
		this.radius = Math.abs(radius1);
	}
788637
function Circle2D( x , y , r ) {
	this.center = new Vector2D( x , y ) ;
	this.r = + r ;
}
955288
function (lineWidth, radius) {
		var center = this.center;
		radius = pick(radius, center[2] / 2 - this.offset);
		
		return this.chart.renderer.symbols.arc(
			this.left + center[0],
			this.top + center[1],
			radius,
			radius, 
			{
				start: this.startAngleRad,
				end: this.endAngleRad,
				open: true,
				innerR: 0
			}
		);
	}
1049219
protected boolean onDrawItem(final Canvas canvas, final Item item, final Point curScreenCoords,
			final Projection pProjection) {

		

		final int state = (mDrawFocusedItem && (mFocusedItem == item) ? OverlayItem.ITEM_STATE_FOCUSED_MASK
				: 0);
		final Drawable marker = (item.getMarker(state) == null) ? getDefaultMarker(state) : item
				.getMarker(state);
		final HotspotPlace hotspot = item.getMarkerHotspot();

		boundToHotspot(marker, hotspot);

		int x = mCurScreenCoords.x;
		int y = mCurScreenCoords.y;

		marker.copyBounds(mRect);
		mRect.offset(x, y);
		RectL.getBounds(mRect, x, y, pProjection.getOrientation(), mOrientedMarkerRect);
		final boolean displayed = Rect.intersects(mOrientedMarkerRect, canvas.getClipBounds());
		if (displayed) {
			if (pProjection.getOrientation() != 0) { // optimization: step 1/2
				canvas.save();
				canvas.rotate(-pProjection.getOrientation(), x, y);
			}
			marker.setBounds(mRect);
			marker.draw(canvas);
			if (pProjection.getOrientation() != 0) { // optimization: step 2/2
				canvas.restore();
			}
		}

		return displayed;
	}
287415
function (point, mouseEvent) {
		var tooltip = this,
			chart = tooltip.chart,
			label = tooltip.label,
			options = tooltip.options,
			x,
			y,
			anchor,
			textConfig = {},
			text,
			pointConfig = [],
			formatter = options.formatter || tooltip.defaultFormatter,
			hoverPoints = chart.hoverPoints,
			borderColor,
			crosshairsOptions = options.crosshairs,
			shared = tooltip.shared,
			currentSeries;
			
		clearTimeout(this.hideTimer);
		
		// get the reference point coordinates (pie charts use tooltipPos)
		tooltip.followPointer = splat(point)[0].series.tooltipOptions.followPointer;
		anchor = tooltip.getAnchor(point, mouseEvent);
		x = anchor[0];
		y = anchor[1];

		// shared tooltip, array is sent over
		if (shared && !(point.series && point.series.noSharedTooltip)) {
			
			// hide previous hoverPoints and set new
			
			chart.hoverPoints = point;
			if (hoverPoints) {
				each(hoverPoints, function (point) {
					point.setState();
				});
			}

			each(point, function (item) {
				item.setState(HOVER_STATE);

				pointConfig.push(item.getLabelConfig());
			});

			textConfig = {
				x: point[0].category,
				y: point[0].y
			};
			textConfig.points = pointConfig;
			point = point[0];

		// single point tooltip
		} else {
			textConfig = point.getLabelConfig();
		}
		text = formatter.call(textConfig, tooltip);

		// register the current series
		currentSeries = point.series;

		// update the inner HTML
		if (text === false) {
			this.hide();
		} else {

			// show it
			if (tooltip.isHidden) {
				stop(label);
				label.attr('opacity', 1).show();
			}

			// update text
			label.attr({
				text: text
			});

			// set the stroke color of the box
			borderColor = options.borderColor || point.color || currentSeries.color || '#606060';
			label.attr({
				stroke: borderColor
			});
			
			tooltip.updatePosition({ plotX: x, plotY: y });
		
			this.isHidden = false;
		}

		// crosshairs
		if (crosshairsOptions) {
			crosshairsOptions = splat(crosshairsOptions); // [x, y]

			var path,
				i = crosshairsOptions.length,
				attribs,
				axis,
				val,
				series;

			while (i--) {
				series = point.series;
				axis = series[i ? 'yAxis' : 'xAxis'];
				if (crosshairsOptions[i] && axis) {
					val = i ? pick(point.stackY, point.y) : point.x; // #814
					if (axis.isLog) { // #1671
						val = log2lin(val);
					}
					if (i === 1 && series.modifyValue) { // #1205, #2316
						val = series.modifyValue(val);
					}

					path = axis.getPlotLinePath(
						val,
						1
					);

					if (tooltip.crosshairs[i]) {
						tooltip.crosshairs[i].attr({ d: path, visibility: VISIBLE });
					} else {
						attribs = {
							'stroke-width': crosshairsOptions[i].width || 1,
							stroke: crosshairsOptions[i].color || '#C0C0C0',
							zIndex: crosshairsOptions[i].zIndex || 2
						};
						if (crosshairsOptions[i].dashStyle) {
							attribs.dashstyle = crosshairsOptions[i].dashStyle;
						}
						tooltip.crosshairs[i] = chart.renderer.path(path)
							.attr(attribs)
							.add();
					}
				}
			}
		}
		fireEvent(chart, 'tooltipRefresh', {
				text: text,
				x: x + chart.plotLeft,
				y: y + chart.plotTop,
				borderColor: borderColor
			});
	}
219692
protected void centerSprite ()
    {
        if (_sprite != null) {
            Dimension d = getSize();
            int shei = _sprite.getHeight();
            int x = d.width / 2, y = (d.height + shei) / 2;
            _sprite.setLocation(x, y);
        }
    }
658842
function (angle, radius) {
		
		var chart = this.chart,
			center = this.center;
			
		angle = this.startAngleRad + angle;

		return {
			x: chart.plotLeft + center[0] + Math.cos(angle) * radius,
			y: chart.plotTop + center[1] + Math.sin(angle) * radius
		}; 
		
	}
42950
public void setCirclePitchAlignment(@Property.CIRCLE_PITCH_ALIGNMENT String value) {
    PropertyValue propertyValue = circlePitchAlignment(value);
    constantPropertyUsageMap.put(PROPERTY_CIRCLE_PITCH_ALIGNMENT, propertyValue);
    layer.setProperties(propertyValue);
  }
1223299
function() {
        var target = this.redoStack && this.redoStack.pop();
        if (target) {
            this.line.geometry.addComponent(target, this.getCurrentPointIndex());
            this.drawFeature();
        }
        return !!target;
    }
1203172
function initArea(proceed, chart, options) {
		proceed.call(this, chart, options);
		if (this.chart.polar) {
		
			/**
			 * Overridden method to close a segment path. While in a cartesian plane the area 
			 * goes down to the threshold, in the polar chart it goes to the center.
			 */
			this.closeSegment = function (path) {
				var center = this.xAxis.center;
				path.push(
					'L',
					center[0],
					center[1]
				);			
			};
		
			// Instead of complicated logic to draw an area around the inner area in a stack,
			// just draw it behind
			this.closedStacks = true;
		}
	}