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

class anychart.cartesian.series.Bubble Improve this Doc

Extends: anychart.cartesian.series.DiscreteBase

Define Bubble series type.
Note: Better for use method anychart.cartesian.Chart#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.cartesian.series.Bubble#negativeFill, anychart.cartesian.series.Bubble#negativeStroke, anychart.cartesian.series.Bubble#negativeHatchFill

Params:

Name Type Description
value boolean Whether to display negative value.

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

Try it:

hoverNegativeFill

Getter for current series 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.cartesian.series.Bubble#displayNegative.

Params:

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

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

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.cartesian.series.Bubble#displayNegative.

Params:

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

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

Try it:

Linear gradient fill.
Learn more about coloring at: https://docs.anychart.com/__VERSION__/General_settings/Elements_Fill
Note: Works only with anychart.cartesian.series.Bubble#displayNegative.

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.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

Try it:

Radial gradient fill.
Learn more about coloring at: https://docs.anychart.com/__VERSION__/General_settings/Elements_Fill
Note: Works only with anychart.cartesian.series.Bubble#displayNegative.

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.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

Try it:

Params:

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

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

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.cartesian.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.cartesian.series.Base - anychart.cartesian.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.cartesian.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 }.

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

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.cartesian.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.

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

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.

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

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.

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

Try it:

negativeFill

Getter for current series 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.cartesian.series.Bubble#displayNegative.

Params:

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

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

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.cartesian.series.Bubble#displayNegative.

Params:

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

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

Try it:

Linear gradient fill.
Learn more about coloring at: https://docs.anychart.com/__VERSION__/General_settings/Elements_Fill
Note: Works only with anychart.cartesian.series.Bubble#displayNegative.

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.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

Try it:

Radial gradient fill.
Learn more about coloring at: https://docs.anychart.com/__VERSION__/General_settings/Elements_Fill
Note: Works only with anychart.cartesian.series.Bubble#displayNegative.

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.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

Try it:

Params:

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

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

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.cartesian.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.cartesian.series.Base - anychart.cartesian.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.cartesian.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 }.

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

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.cartesian.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.

Returns:

anychart.cartesian.series.Bubble - anychart.cartesian.series.Bubble instance for method chaining.

Try it: