Skip to content

circle

Draws a circle for each data item. A convenience wrapper around rect with equal width/height and full border radius.

js
gf.Chart([{ size: 40 }])
  .mark(gf.circle({ r: 40, fill: "coral" }))
  .render(root, { w: 150, h: 150 });

Signature

ts
circle({ r?, fill?, stroke?, strokeWidth?, debug? })

Parameters

OptionTypeDescription
rnumberRadius of the circle
fillstringFill color or field name for color encoding
strokestringStroke color
strokeWidthnumberStroke width (default 0)
debugbooleanLog debug info to console

Examples

ts
// Fixed size circle
.mark(circle({ r: 10, fill: "steelblue" }))

// Circle with stroke
.mark(circle({ r: 15, fill: "white", stroke: "black", strokeWidth: 2 }))

// Named for use with select()
.mark(circle({ r: 8 }).name("points"))