Top
You are looking at an outdated 7.6.0 version of this document. Switch to the 8.0.1 version to see the up to date information.

class anychart.gauges.Circular Improve this Doc

Extends: anychart.core.Chart

Circular gauge class.

Methods Overview

Miscellaneous
axis()Getter for default gauge axis settings.
bar()Getter for bar pointer.
cap()Getter for gauge cap.
circularPadding()Getter for circular space around gauge.
data()Getter for pointers mapping.
encloseWithStraightLine()Getter for enclose frame path with straight line.
fill()Getter for current fill color.
getType()Returns gauge type.
knob()Getter for knob pointer.
marker()Getter for marker pointer.
needle()Getter for needle pointer.
range()Getter for circular range.
startAngle()Getter for gauge start angle.
stroke()Getter for current stroke settings.
sweepAngle()Getter for gauge sweep angle.

Methods Description

axis

Getter for default gauge axis settings.

Returns:

anychart.core.axes.Circular - Axis instance.

Try it:

Setter for gauge axis settings.

Params:

Name Type Default Description
value Object | boolean | null
false
Axis settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.
Setter for gauge axis by index.

Params:

Name Type Default Description
index number
0
Index of gauge axis.
value Object | boolean | null
Gauge axis settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

bar

Getter for bar pointer.

Params:

Name Type Default Description
index number
0
Bar pointer index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.gauge.pointers.Bar - Bar pointer instance by index.

Try it:

Setter for first bar pointer.

Params:

Name Type Default Description
value Object | boolean | null
false
Bar pointer settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.
Setter for bar pointer by index.

Params:

Name Type Default Description
index number
0
Index of bar pointer.
value Object | boolean | null
Bar pointer settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

cap

Getter for gauge cap.

Returns:

anychart.core.gauge.Cap - Cap instance.

Try it:

Gauge cap.

Params:

Name Type Default Description
value Object | boolean
false
Gauge cap settings.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

circularPadding

Getter for circular space around gauge.

Returns:

string - Current circular padding.

Try it:

Setter for circular space around gauge.

Params:

Name Type Default Description
value number | string
'10%'
Value to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

Try it:

data

Getter for pointers mapping.

Returns:

anychart.data.View - Returns current mapping.

Try it:

Setter for pointers mapping

Params:

Name Type Description
value anychart.data.View | anychart.data.Set | Array | string Value to set.
csvSettings Object.<string, (string|boolean)> If CSV string is passed, you can pass CSV parser settings here as a hash map.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

encloseWithStraightLine

Getter for enclose frame path with straight line.

Returns:

boolean - Current value.

Try it:

Setter for enclose frame path with straight line.

Params:

Name Type Default Description
value boolean
false
Boolean flag.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

Try it:

fill

Getter for current fill color.

Returns:

anychart.graphics.vector.Fill - Current fill color.

Try it:

Sets fill settings using an object or a string. Learn more about coloring.

Params:

Name Type Default Description
value anychart.graphics.vector.Fill
{angle: 315, keys: ['#FFF', '#DCDCDC'], mode: false, opacity: 1}
Color as an object or a string.

Returns:

anychart.gauges.Circular - Self instance for method chaining.
Fill color with opacity. Fill as a string or an object.

Params:

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

Returns:

anychart.gauges.Circular - Self instance for method chaining.

Try it:

Linear gradient fill. 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.gauges.Circular - Self instance for method chaining.

Try it:

Radial gradient fill. 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.gauges.Circular - Self instance for method chaining.

Try it:

Params:

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

Returns:

anychart.gauges.Circular - Self instance for method chaining.

Try it:

getType

Returns gauge type.

Returns:

anychart.enums.GaugeTypes - Current gauge type.

Try it:

knob

Getter for knob pointer.

Params:

Name Type Default Description
index number
0
Knob pointer index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.gauge.pointers.Knob - Knob pointer instance by index.

Try it:

Setter for first knob pointer.

Params:

Name Type Default Description
value Object | boolean | null
false
Knob pointer settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.
Setter for knob pointer by index.

Params:

Name Type Default Description
index number
0
Index of knob pointer.
value Object | boolean | null
Knob pointer settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

marker

Getter for marker pointer.

Params:

Name Type Default Description
index number
0
Marker pointer index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.gauge.pointers.Marker - Marker pointer instance by index.

Try it:

Setter for first marker pointer.

Params:

Name Type Default Description
value Object | boolean | null
false
Marker pointer settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.
Setter for marker pointer by index.

Params:

Name Type Default Description
index number
0
Index of marker pointer.
value Object | boolean | null
Marker pointer settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

needle

Getter for needle pointer.

Params:

Name Type Default Description
index number
0
Needle pointer index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.gauge.pointers.Needle - Needle pointer instance by index.

Try it:

Setter for first needle pointer.

Params:

Name Type Default Description
value Object | boolean | null
false
Needle pointer settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.
Setter for needle pointer by index.

Params:

Name Type Default Description
index number
0
Index of needle pointer.
value Object | boolean | null
Needle pointer settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

range

Getter for circular range.

Params:

Name Type Default Description
index number
0
Circular range index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.axisMarkers.CircularRange - Circular range instance by index.

Try it:

Setter for circular first range settings.

Params:

Name Type Default Description
value Object | boolean | null
false
Circular range settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.
Setter for circular range settings by index.

Params:

Name Type Default Description
index number
0
Index of range.
value Object | boolean | null
Circular range settings to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

startAngle

Getter for gauge start angle.

Returns:

number - Current value of start angle.

Try it:

Setter for gauge start angle.

Params:

Name Type Default Description
value string | number
0
Value to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

Try it:

stroke

Getter for current stroke settings.

Returns:

anychart.graphics.vector.Stroke - Current stroke settings.

Try it:

Setter for stroke settings. Learn more about stroke settings.

Params:

Name Type Default Description
strokeOrFill anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
'#ccc'
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.gauges.Circular - Self instance for method chaining.

Try it:

sweepAngle

Getter for gauge sweep angle.

Returns:

number - Current value of sweep angle.

Try it:

Setter for gauge sweep angle.

Params:

Name Type Default Description
value string | number
360
Value to set.

Returns:

anychart.gauges.Circular - Self instance for method chaining.

Try it: