AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.ui.Center Improve this Doc

Extends: anychart.core.Base

Center class.

Methods Overview

Specific settings
content()Center content settings.
Coloring
fill()Fill settings.
stroke()Stroke settings.
Size and Position
getBounds()Returns pie center content bounds.
getPoint()Gets the pie chart center point.

Methods Description

content

Getter for the center content.
See listing
var content = center.content();
Setter for the center content.

Params:

NameTypeDescription
contentSettingsanychart.graphics.vector.Element | anychart.core.VisualBase | ObjectContent to set.

Returns:

anychart.core.ui.Center - Self instance for method chaining.

fill

Getter for fill settings.

Returns:

anychart.graphics.vector.Fill | string - Center fill settings.
Setter for fill settings using an array, an object and a string. Learn more about coloring.

Params:

NameTypeDescription
coloranychart.graphics.vector.Fill | Array.<(anychart.graphics.vector.GradientKey|string)>Fill as an object, an array or a string.

Returns:

anychart.core.ui.Center - Self instance for method chaining.
Fill color with opacity. Fill as a string or an object.

Params:

NameTypeDescription
colorstringColor as a string.
opacitynumberColor opacity.

Returns:

anychart.core.ui.Center - Self instance for method chaining.
Linear gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Gradient keys.
anglenumberGradient angle.
modeboolean | anychart.graphics.vector.Rect | ObjectGradient mode.
opacitynumberGradient opacity.

Returns:

anychart.core.ui.Center - Self instance for method chaining.
Radial gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Color-stop gradient keys.
cxnumberX ratio of center radial gradient.
cynumberY ratio of center radial gradient.
modeanychart.graphics.math.RectIf defined then userSpaceOnUse mode, else objectBoundingBox.
opacitynumberOpacity of the gradient.
fxnumberX ratio of focal point.
fynumberY ratio of focal point.

Returns:

anychart.core.ui.Center - Self instance for method chaining.

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

anychart.core.ui.Center - Self instance for method chaining.

getBounds

Returns pie center content bounds.

Returns:

anychart.math.Rect - Bounds.

getPoint

Gets the pie chart center point.
Note: Works only after anychart.core.ui.Chart#draw is called.

Returns:

anychart.math.CoordinateObject - XY coordinate of the pie chart center.

stroke

Getter for center stroke settings.

Returns:

anychart.graphics.vector.Stroke - Stroke settings.
Setter for center stroke settings. Learn more about stroke settings.

Params:

NameTypeDefaultDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
Stroke settings.
thicknessnumber
1
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to stroke paths.
lineJoinstring | anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCapstring | anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.map.series.Base - Self instance for method chaining.
Setter for stroke using an object.

Params:

NameTypeDescription
settingsObjectStroke settings from anychart.graphics.vector.Stroke.

Returns:

anychart.core.ui.Center - Self instance for method chaining.