ArcPath

extends Path

The ArcPath class represents a sector mark that is used in a Doughnut Chart and a Sunburst Chart. This class is also used to represent a pie mark that is used in a pie chart. A pie is a special arc where the inner radius is 0. You cannot create an ArcPath object directly, instead, you need to use the divide method in the Scene class to transform a RingPath to a collection of ArcPath objects (or transform a CirclePath to a collection of pie marks). Here is an explanation of the divide operation.

Properties

propertyexplanationtypedefault value
innerRadiusthe inner radius of the arcNumber100
outerRadiusthe outer radius of the arcNumber200
startAnglethe start angle of the arc in degreesNumber0
endAnglethe end angle of the arc in degreesNumber90
angle the angle between the start angle and the end angle in degreesNumber90
thickness the difference between the outer radius and inner radiusNumber100

Angles in Mascot are specified using the polar coordinate system, where 0 is at the positive x axis, and the angle increases in the counterclockwise direction. The figure below illustrates various values of startAngle and endAngle.

start angle and end angle for an arc

The same applies to a pie mark as well:

start angle and end angle for a pie

Properties inherited from Path

propertyexplanationtypedefault value
bounds the bounding rectangle of the pathRectangle
xthe x coordinate of the center of the arcNumber0
ythe y coordinate of the center of the arcNumber0
vertices the vertices along the pathArray
segments the segments on the pathArray
firstVertex returns the first vertex of the pathVertex
firstSegment returns the first segment of the pathSegment
fillColorthe fill color of the path if it is closedColorundefined
strokeColorthe stroke color of the pathColor“#ccc”
strokeDashthe dashes and gaps for the path strokeString“none”
strokeWidththe stroke width of the path in pixelsNumber1
opacitythe opacity value of the path (between 0 and 1)Number1
vxShapethe shape of the vertices on this path
possible values: “rect”, “circle”
Stringundefined
vxWidththe width of the vertices on this pathNumber0
vxHeightthe height of the vertices on this pathNumber0
vxRadiusthe radius of the vertices on this path if the shape is “circle”Number0
vxFillColorthe fill color of the vertices on this pathColor“#555”
vxStrokeColorthe stroke color of the vertices on this pathColor“#aaa”
vxStrokeWidththe stroke width of the vertices on this path in pixelsNumber0
vxOpacitythe opacity of the vertices on this pathNumber1

Properties inherited from Mark

propertyexplanationtypedefault value
id the unique id of the pathString
type the type of the pathString“circle”
dataScopethe data scope of the pathDataScopeundefined

Methods

methodexplanationreturn type
adjustAngle(start, end)set the start angle and the end angle
start (Number): start angle in degrees
end (Number): end angle in degrees
sweepOver(arc)returns if the angle of this arc contains the angle of the argument arc
arc (ArcPath): argument arc
Boolean

Methods inherited from Path

methodexplanationreturn type
getSVGPathData()returns a string to be used as the d parameter in an SVG path elementString

Methods inherited from Mark

methodexplanationreturn type
contains(x, y)whether this mark contains a point
x (Number): x coordinate of the point
y (Number): y coordinate of the point
Boolean
getScene()returns the scene in which this mark residesScene
duplicate()returns a copy of this markArcPath