Components

Shapes

SVG building blocks for custom bars, points, sectors and cursors

The shape components are the SVG pieces that the series draw: a bar is a Rectangle, a pie slice is a Sector, a line is a Curve. Use them in #shape, #activeBar, #dot or #content slots to change one detail of an item and keep the rest of the geometry.

Every shape takes its geometry as props and passes other attributes (fill, stroke, class, opacity, events) to the SVG element. A shape with missing or invalid geometry renders nothing.

Use a shape in a slot

The #shape slot of Bar gets the geometry of each bar. Pass it on to a Rectangle with rounded top corners; #activeBar draws the hovered bar.

Rectangle

A rectangle with optional rounded corners. Bar, ReferenceArea and the Tooltip cursor of a bar chart draw it.

PropTypeDefaultDescription
x, ynumber0Top left corner
width, heightnumber0Size. Negative values grow to the left or up
radiusnumber | [tl, tr, br, bl]—Corner radius, one value or one per corner. Capped at half the smaller side
<Bar data-key="value">
  <template #shape="{ x, y, width, height, fill }">
    <Rectangle :x="x" :y="y" :width="width" :height="height" :radius="[6, 6, 0, 0]" :fill="fill" />
  </template>
</Bar>

Dot

A circle. Line, Area and Radar draw their dots with it, and ReferenceDot draws its marker.

PropTypeDescription
cx, cynumberCenter
rnumberRadius
<Line data-key="value">
  <template #dot="{ cx, cy, value }">
    <Dot :cx="cx" :cy="cy" :r="value > 250 ? 6 : 3" fill="#f97316" />
  </template>
</Line>

Sector

A ring segment. Pie, RadialBar and SunburstChart draw their slices with it.

PropTypeDefaultDescription
cx, cynumber0Center
inner-radius, outer-radiusnumber0Radii in px. 0 inner radius draws a pie slice
start-angle, end-anglenumber0Angles in degrees. 0 points right; angles grow counterclockwise
corner-radiusnumber | string0Rounds the corners
force-corner-radiusbooleanfalseKeep the corner radius on very thin sectors
corner-is-externalbooleanfalseRound the corners outwards
<Pie :data="data" data-key="value">
  <template #activeShape="sector">
    <Sector v-bind="sector" :outer-radius="sector.outerRadius + 8" />
  </template>
</Pie>

Curve

A line or area path through points. Line, Area and the line of a Scatter draw their path with it.

PropTypeDescription
points{ x, y }[]Points of the path. A point with x or y set to null is a gap
typeCurveType | CurveFactoryInterpolation: 'linear', 'monotone', 'step', 'basis', 'natural' and the other d3 curves, or your own d3 curve factory
base-linenumber | { x, y }[]Draw an area down to this value or path instead of a line
layout'horizontal' | 'vertical'Direction of the area base line
connect-nullsbooleanJoin the path across gaps
pathstringA ready SVG path; skips the calculation
<Line data-key="value">
  <template #shape="curve">
    <Curve v-bind="curve" stroke-dasharray="4 4" />
  </template>
</Line>

Symbols

A marker symbol. Scatter and the Legend icons draw it.

PropTypeDefaultDescription
type'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye''circle'Symbol
cx, cynumber—Center
sizenumber64Size of the symbol
size-type'area' | 'diameter''area'Read size as an area in px² or as a diameter in px
<Scatter :data="data">
  <template #shape="{ cx, cy, isActive }">
    <Symbols type="diamond" :cx="cx" :cy="cy" :size="isActive ? 160 : 80" fill="#14b8a6" />
  </template>
</Scatter>

Trapezoid

A trapezoid with a horizontal top and bottom. Funnel draws its stages with it.

PropTypeDefaultDescription
x, ynumber0Top left corner
upper-widthnumber0Width of the top edge
lower-widthnumber0Width of the bottom edge, centered under the top edge
heightnumber0Height
<Funnel :data="data" data-key="value">
  <template #shape="stage">
    <Trapezoid v-bind="stage" stroke="#fff" :stroke-width="2" />
  </template>
</Funnel>

Cross

Two lines that cross: a horizontal line at y and a vertical line at x. The Tooltip cursor of a scatter chart draws it.

PropTypeDefaultDescription
x, ynumber0Position of the vertical and the horizontal line
top, leftnumber0Start of the vertical and the horizontal line
width, heightnumber0Length of the horizontal and the vertical line

Polygon

A closed path through points. It builds the same path as the polygon rings of PolarGrid; use it to draw your own Radar area.

PropTypeDescription
points{ x, y }[]Corners in order. If one corner is not a number, nothing renders
<Radar data-key="score">
  <template #shape="{ points, fill }">
    <Polygon :points="points" :fill="fill" fill-opacity="0.3" stroke="#f97316" />
  </template>
</Radar>

Cursors

The #cursor slot of <Tooltip> receives the props of the default cursor shape: Rectangle for bar charts, Curve for line and area charts, Cross for scatter charts and Sector for radial charts. See Tooltip.

Copyright © 2026