class anychart.core.ui.Separator Improve this Doc
Extends: anychart.core.VisualBase
Class for a separator element.
The Separator class contains methods for configuring the Legend
and Tooltip separator.
Methods Overview
Coloring | |
fill() | Fill settings. |
stroke() | Stroke settings. |
Interactivity | |
enabled() | Element state (enabled or disabled). |
Size and Position | |
getRemainingBounds() | Remaining bounds. |
height() | Height settings. |
margin() | Getter for the separator margin. |
orientation() | Getter for the separator orientation. |
width() | Width settings. |
zIndex() | Z-index of the element. |
Methods Description
enabled
Getter for the element state (enabled or disabled).
Returns:
boolean - Element state.Try it:
Setter for the element enabled state.
Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | boolean | true | Enabled state to set. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining. Example.
if (!element.enabled()) element.enabled(true);
Try it:
fill
Getter for the separator fill.
Returns:
anychart.graphics.vector.Fill - Fill settings. See listing
var separator = legend.titleSeparator(); var fill = separator.fill();
Setter for separator fill settings using an array, an object or a string.
Learn more about coloring.
Params:
Name | Type | Description |
---|---|---|
color | anychart.graphics.vector.Fill | Array.<(anychart.graphics.vector.GradientKey|string)> | string | Color as an array, an object or string. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Fill color with opacity.
Detailed description
Note: If color is set as a string (e.g. 'red .5') it has a priority over opt_opacity, which
means: color set like this rect.fill('red 0.3', 0.7) will have 0.3 opacity.
Params:
Name | Type | Description |
---|---|---|
color | string | Color as a string. |
opacity | number | Color opacity. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it:
Linear gradient fill for the separator.
Learn more about coloring.
Params:
Name | Type | Description |
---|---|---|
keys | Array.<(anychart.graphics.vector.GradientKey|string)> | Gradient keys. |
angle | number | Gradient angle. |
mode | boolean | anychart.graphics.vector.Rect | Object | Gradient mode. |
opacity | number | Gradient opacity. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it:
Radial gradient fill for the separator.
Learn more about coloring.
Params:
Name | Type | Description |
---|---|---|
keys | Array.<(anychart.graphics.vector.GradientKey|string)> | Color-stop gradient keys. |
cx | number | X ratio of center radial gradient. |
cy | number | Y ratio of center radial gradient. |
mode | anychart.graphics.math.Rect | If defined then userSpaceOnUse mode, else objectBoundingBox. |
opacity | number | Opacity of the gradient. |
fx | number | X ratio of focal point. |
fy | number | Y ratio of focal point. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it:
Image fill for the separator.
Learn more about coloring.
Params:
Name | Type | Description |
---|---|---|
imageSettings | anychart.graphics.vector.Fill | Object with settings. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it:
getRemainingBounds
Returns the remaining (after separator placement) part of the container.
Returns:
anychart.math.Rect - Parent bounds without the space used by the separator.height
Getter for the separator height.
Returns:
number | string | null - Returns separator height. See listing
var separator = legend.titleSeparator(); var height = separator.height();
Setter for the separator height.
Params:
Name | Type | Description |
---|---|---|
height | number | string | null | Height to set. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it:
margin
Setter for the margin using a single value.
Params:
Name | Type | Description |
---|---|---|
margin | Array.<(number|string)> | Object | Margin to set. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it:
Setter for the callout margin using several values.
Params:
Name | Type | Description |
---|---|---|
value1 | string | number | Top or top-bottom space. |
value2 | string | number | Right or right-left space. |
value3 | string | number | Bottom space. |
value4 | string | number | Left space. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it:
orientation
Getter for the separator orientation.
Returns:
anychart.enums.Orientation | string - Return the separator orientation. See listing
var separator = legend.titleSeparator(); var orientation = separator.orientation();
Setter for the separator orientation.
Params:
Name | Type | Description |
---|---|---|
orientation | anychart.enums.Orientation | string | Orientation settings. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it:
stroke
Getter for the separator stroke.
Returns:
anychart.graphics.vector.Stroke - Stroke settings. See listing
var separator = legend.titleSeparator(); var stroke = separator.stroke();
Setter for the separator stroke.
Params:
Name | Type | Description |
---|---|---|
color | anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null | Stroke settings. |
thickness | number | Thickness settings. |
dashpattern | string | Dash pattern settings. |
lineJoin | string | anychart.graphics.vector.StrokeLineJoin | Line join settings. |
lineCap | string | anychart.graphics.vector.StrokeLineCap | Line cap settings. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it:
Setter for the separator stroke using an object.
Params:
Name | Type | Description |
---|---|---|
settings | Object | Stroke settings from anychart.graphics.vector.Stroke. |
Returns:
anychart.core.grids.Radar - Self instance for method chaining.Try it:
width
Getter for the separator width.
Returns:
number | string | null - Returns separator width. See listing
var separator = legend.titleSeparator(); var width = separator.width();
Setter for the separator width.
Params:
Name | Type | Description |
---|---|---|
width | number | string | null | Width to set. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it:
zIndex
Setter for the Z-index of the element.
Detailed description
The bigger the index - the higher the element position is.
Params:
Name | Type | Default | Description |
---|---|---|---|
zIndex | number | 0 | Value to set. |
Returns:
anychart.core.ui.Separator - Self instance for method chaining.Try it: