Constructor
new Arc(strokeopt, backgroundopt, opacityopt, xopt, yopt, widthopt, heightopt, startAngleopt, extentopt)
Creates an instance of Arc shape.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
stroke | Stroke | <optional> | A border of the shape. | |
background | string | <optional> | Color, gradient, or image background, similar to CSS. Use an empty string to remove the background. | |
opacity | number | <optional> | 1 | Opacity of the shape (0 to 1). |
x | number | <optional> | 0 | Horizontal position from the left edge. |
y | number | <optional> | 0 | Vertical position from the top edge. |
width | number | <optional> | 100 | Width of the arc (horizontal diameter). |
height | number | <optional> | Height of the arc (vertical diameter). If omitted, height will be same as width. | |
startAngle | number | <optional> | 0 | Starting angle of the arc (0 to 360 degrees). |
extent | number | <optional> | 360 | How much of the arc to remove (0 to 360 degrees). |
- See
Classes
Members
(readonly) Type :number
Enum for arc drawing types: Pie and Chord.
- number
| Name | Type | Description |
|---|---|---|
Chord | number | Draws the arc as a straight chord between the start and end points. |
Pie | number | Draws the arc as a pie shape (arc connected to the center). |
Arc.Type.PieMethods
extent(extentopt) → {number|Arc}
Sets or gets an extent value of the Arc. Extent defines how much of the arc is removed by setting an angle between 0 and 360.
| Name | Type | Attributes | Description |
|---|---|---|---|
extent | number | <optional> | Extent value between 0 and 360. |
If called without parameters, current value is returned; otherwise this Arc object is returned.
- Type:
- number |
Arc
holeSize(width, heightopt) → {Object|Arc}
Sets or gets the size of the hollow space inside the arc. The hole make it look more like a donut.
| Name | Type | Attributes | Description |
|---|---|---|---|
width | number | | Width of the hole (horizontal diameter), or a size object (e.g., {width:50,height:50}). | |
height | number | <optional> | Height of the hole (vertical diameter). |
If called without parameters, current hole size is returned; otherwise this Arc object is returned.
- Type:
- Object |
Arc
size(width, heightopt) → {Object|Arc}
Sets or gets the size of the arc (horizontal and vertical diameter).
| Name | Type | Attributes | Description |
|---|---|---|---|
width | number | | Width of the arc (horizontal diameter), or a size object (e.g., {width:300,height:300}). | |
height | number | <optional> | Height of the arc (vertical diameter). |
If called without parameters, current size is returned; otherwise this Arc object is returned.
- Type:
- Object |
Arc
startAngle(angleopt) → {number|Arc}
Gets or sets the starting angle of the arc.
The starting angle defines where the arc begins, measured in degrees from the positive x-axis in a clockwise direction.
| Name | Type | Attributes | Description |
|---|---|---|---|
angle | number | <optional> | Sets the start angle (0 to 360 degrees). |
Returns the current start angle if no parameter is given, otherwise returns the Arc instance for chaining.
- Type:
- number |
Arc
toObject(includeopt) → {object}
Returns a JSON object that contains this shape properties. It may be converted back to this shape.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
include | string | <optional> | "all" | Specified what to include. "all" is default. Valid values are: "all", "stroke", "background", "points", "basic". |
Returns an object containing this shape's properties.
- Type:
- object
type(typeopt) → {Arc.Type|Arc}
Sets or gets the type of the arc to Arc.Type.Chord or Arc.Type.Pie
| Name | Type | Attributes | Description |
|---|---|---|---|
type | Arc. | <optional> | One of the type values: Arc.Type.Pie, Arc.Type.Chord |
If called without parameters, current type is returned; otherwise this Arc object is returned.
- Type:
- Arc.
Type |Arc