Circle / Ellipse
circle draws a circle by center and radius. ellipse draws an ellipse with separate x and y radii.
circle attributes
Section titled “circle attributes”| Attribute | Type | Default | Description |
|---|---|---|---|
cx |
signed pt | — | Center X (or offset from anchor) |
cy |
signed pt | — | Center Y (or offset from anchor) |
r |
pt | — | Required. Radius |
anchor |
string | — | Reference point |
fill |
color | — | Fill color |
stroke |
color | — | Stroke color |
stroke-width |
pt | — | Stroke width |
stroke-dash |
string | — | Dash pattern |
opacity |
0–1 | 1 | Opacity |
ellipse attributes
Section titled “ellipse attributes”Same as circle except r is replaced by:
| Attribute | Type | Description |
|---|---|---|
rx |
pt | Required. Horizontal radius |
ry |
pt | Required. Vertical radius |
Circle
Section titled “Circle”<circle cx="100pt" cy="100pt" r="40pt" fill="#1a73e8" opacity="0.8"/>L.circle({ cx: '100pt', cy: '100pt', r: '40pt', fill: '#1a73e8', opacity: '0.8' })L.circle(CircleAttr(cx='100pt', cy='100pt', r='40pt', fill='#1a73e8', opacity='0.8'))L::circle(new CircleAttr(cx: '100pt', cy: '100pt', r: '40pt', fill: '#1a73e8', opacity: '0.8'))L.Circle(new() { Cx = "100pt", Cy = "100pt", R = "40pt", Fill = "#1a73e8", Opacity = "0.8" })Hollow circle (stroke only)
Section titled “Hollow circle (stroke only)”<circle cx="306pt" cy="396pt" r="200pt" stroke="#e0e0e0" stroke-width="1pt"/>L.circle({ cx: '306pt', cy: '396pt', r: '200pt', stroke: '#e0e0e0', strokeWidth: '1pt' })L.circle(CircleAttr(cx='306pt', cy='396pt', r='200pt', stroke='#e0e0e0', stroke_width='1pt'))L::circle(new CircleAttr(cx: '306pt', cy: '396pt', r: '200pt', stroke: '#e0e0e0', strokeWidth: '1pt'))L.Circle(new() { Cx = "306pt", Cy = "396pt", R = "200pt", Stroke = "#e0e0e0", StrokeWidth = "1pt" })Ellipse anchored to page center
Section titled “Ellipse anchored to page center”<ellipse anchor="center" rx="150pt" ry="80pt" fill="#f0f4ff" opacity="0.5"/>L.ellipse({ anchor: 'center', rx: '150pt', ry: '80pt', fill: '#f0f4ff', opacity: '0.5' })L.ellipse(EllipseAttr(anchor='center', rx='150pt', ry='80pt', fill='#f0f4ff', opacity='0.5'))L::ellipse(new EllipseAttr(anchor: 'center', rx: '150pt', ry: '80pt', fill: '#f0f4ff', opacity: '0.5'))L.Ellipse(new() { Anchor = "center", Rx = "150pt", Ry = "80pt", Fill = "#f0f4ff", Opacity = "0.5" })