Skip to content
On this page

Arc Shape

TIP

This class is a descendant of Shape it also inherits all the options that Shape provides.

TIP

This component also supports a return function

To create an arc shape with fcanvas, we can instantiate a Arc object.

In addition, this shape also provides a few other parameters:

Require Options

NameTypeDescription
innerRadiusMayBeRef<number>inner ring radius length
outerRadiusMayBeRef<number>outer circumference length

Inherit Shape

NameTypeDescription
xMayBeRef<number>offset x
yMayBeRef<number>offset y

Optional Options

NameTypeDefaultDescription
angleMayBeRef<number>360 degressHow many degrees is the angle from the x-axis?
clockwiseMayBeRef<boolean>falseThe drawing angle should be clockwise or counterclockwise

Demo

ts
import { Stage, Layer, Arc } from "fcanvas"

const stage = new Stage().mount("#app")
const layer = new Layer().addTo(stage)

const arc = new Arc({
  x: stage.size.width / 2,
  y: stage.size.height / 2,
  innerRadius: 40,
  outerRadius: 70,
  angle: 60,
  fill: "yellow",
  stroke: "dark",
  strokeWidth: 4
}).addTo(layer)

Released under the MIT License.