AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated 7.3.0 version of this document. Switch to the 8.1.0 version to see the up to date information.

class anychart.core.scatter.series.Bubble Improve this Doc

Extends: anychart.core.scatter.series.BaseWithMarkers

Define Bubble series type.
Get instance by methods anychart.charts.Scatter#bubble.

Methods Overview

Miscellaneous
displayNegative()Getter for current negative value option.
hoverNegativeFill()Fill as a string or an object.
hoverNegativeHatchFill()Getter for current hatch fill settings.
hoverNegativeStroke()Getter for current stroke settings.
maximumSize()Getter for current maximum bubble size.
minimumSize()Getter for current minimum bubble size.
negativeFill()Fill as a string or an object.
negativeHatchFill()Getter for current hatch fill settings.
negativeStroke()Getter for current stroke settings.

Methods Description

displayNegative

Getter for current negative value option.

Returns:

boolean - Display negaitve setting .
Setter for negative value option.
Note: Negative values are sized basing on absolute value, but shown in a different color. See anychart.core.scatter.series.Bubble#negativeFill, anychart.core.scatter.series.Bubble#negativeStroke, anychart.core.scatter.series.Bubble#negativeHatchFill

Params:

Name Type Description
value boolean Whether to display negative value.

Try it:

hoverNegativeFill

Getter for current series negative hover fill color.

Returns:

anychart.graphics.vector.Fill - Current fill color.
Sets fill settings using an object or a string.
Learn more about coloring at: https://docs.anychart.com/__VERSION__/General_settings/Elements_Fill
Note: Works only with anychart.core.scatter.series.Bubble#displayNegative.

Params:

Name Type Default Description
value anychart.graphics.vector.Fill
null
Color as an object or a string.

Try it:

Fill color with opacity.
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.
Note: Works only with anychart.core.scatter.series.Bubble#displayNegative.

Params:

Name Type Description
color string Color as a string.
opacity number Color opacity.

Try it:

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.

Try it:

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.

Try it:

Params:

Name Type Description
imageSettings anychart.graphics.vector.Fill Object with settings.

Try it:

hoverNegativeHatchFill

Getter for current hatch fill settings.
Setter for hatch fill settings.
Learn more about coloring at: https://docs.anychart.com/__VERSION__/General_settings/Elements_HatchFill
Note: Works only with anychart.core.scatter.series.Bubble#displayNegative.

Params:

Name Type Description
patternFillOrType anychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function | anychart.graphics.vector.HatchFill.HatchFillType | string PatternFill or HatchFill instance or type of hatch fill.
color string Color.
thickness number Thickness.
size number Pattern size.

Returns:

anychart.core.scatter.series.Base - anychart.core.scatter.series.Base instance for method chaining.

Try it:

hoverNegativeStroke

Getter for current stroke settings.

Returns:

anychart.graphics.vector.Stroke function - Current stroke settings.
Setter for series stroke by function.
Note: Works only with anychart.core.scatter.series.Bubble#displayNegative.

Params:

Name Type Default Description
fillFunction function
function() {
 return anychart.color.darken(this.sourceColor);
}
Function that looks like function(){ // this.sourceColor - color returned by fill() getter. return fillValue; // type anychart.graphics.vector.Fill }.

Try it:

Setter for stroke settings.
Learn more about stroke settings: https://docs.anychart.com/__VERSION__/General_settings/Elements_Stroke
Note: Works only with anychart.core.scatter.series.Bubble#displayNegative.

Params:

Name Type Default Description
strokeOrFill anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Fill settings or stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Try it:

maximumSize

Getter for current maximum bubble size.

Returns:

string number - Maximum size of the bubble.
Setter for maximum bubble size.

Params:

Name Type Default Description
value string | number
'95%'
Maximum size of the bubble.

Try it:

minimumSize

Getter for current minimum bubble size.

Returns:

string number - Minimum size of the bubble.
Setter for minimum bubble size.

Params:

Name Type Default Description
value string | number
'10%'
Minimum size of the bubble.

Try it:

negativeFill

Getter for current series negative fill color.

Returns:

anychart.graphics.vector.Fill - Current fill color.
Sets fill settings using an object or a string.
Learn more about coloring at: https://docs.anychart.com/__VERSION__/General_settings/Elements_Fill
Note: Works only with anychart.core.scatter.series.Bubble#displayNegative.

Params:

Name Type Default Description
value anychart.graphics.vector.Fill
null
Color as an object or a string.

Try it:

Fill color with opacity.
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.
Note: Works only with anychart.core.scatter.series.Bubble#displayNegative.

Params:

Name Type Description
color string Color as a string.
opacity number Color opacity.

Try it:

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.

Try it:

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.

Try it:

Params:

Name Type Description
imageSettings anychart.graphics.vector.Fill Object with settings.

Try it:

negativeHatchFill

Getter for current hatch fill settings.
Setter for hatch fill settings.
Learn more about coloring at: https://docs.anychart.com/__VERSION__/General_settings/Elements_HatchFill
Note: Works only with anychart.core.scatter.series.Bubble#displayNegative.

Params:

Name Type Description
patternFillOrType anychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function | anychart.graphics.vector.HatchFill.HatchFillType | string PatternFill or HatchFill instance or type of hatch fill.
color string Color.
thickness number Thickness.
size number Pattern size.

Returns:

anychart.core.scatter.series.Base - anychart.core.scatter.series.Base instance for method chaining.

Try it:

negativeStroke

Getter for current stroke settings.

Returns:

anychart.graphics.vector.Stroke function - Current stroke settings.
Setter for series stroke by function.
Note: Works only with anychart.core.scatter.series.Bubble#displayNegative.

Params:

Name Type Default Description
fillFunction function
function() {
 return anychart.color.darken(this.sourceColor);
}
Function that looks like function(){ // this.sourceColor - color returned by fill() getter. return fillValue; // type anychart.graphics.vector.Fill }.

Try it:

Setter for stroke settings.
Learn more about stroke settings: https://docs.anychart.com/__VERSION__/General_settings/Elements_Stroke
Note: Works only with anychart.core.scatter.series.Bubble#displayNegative.

Params:

Name Type Default Description
strokeOrFill anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Fill settings or stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Try it: