Intro
Basics
AxisLabels

Labels

We can add labels to a chart by specifying a location. We're showing a point at the coordinate of each label for clarity.

020406080100
020406080100
Axis one
Axis two

This is a label at (60,40)

This is a label at (20,80)

<Label x={60} y={40}>
This is a label at (60,40)
</Label>
<Label x={20} y={80}>
This is a label at (20,80)
</Label>

The horizontal alignment is controlled with the align prop and can be left right or center.

020406080100
020406080100
Axis one
Axis two

This label is right aligned

This label is center aligned

This label is left aligned

<Label x={50} y={15} align='right'>
This label is right aligned
</Label>
<Label x={50} y={50} width={50} align='center'>
This label is center aligned
</Label>
<Label x={50} y={85} align='left'>
This label is left aligned
</Label>

The vertical alignment is controlled with the verticalAlign prop and can be top bottom or middle.

020406080100
020406080100
Axis one
Axis two

This label is top aligned

This label is middle aligned

This label is bottom aligned

<Label x={50} y={15} align='center' width={50} verticalAlign='top'>
This label is top aligned
</Label>
<Label
x={50}
y={50}
align='center'
height={50}
width={50}
verticalAlign='middle'
>
This label is middle aligned
</Label>
<Label x={50} y={85} align='center' width={50} verticalAlign='bottom'>
This label is bottom aligned
</Label>
EMAIL
hello@carbonplan.org
NEWSLETTER
Subscribe
CarbonPlan is a registered nonprofit public benefit corporation in California with 501(c)(3) status.
(c) 2024 CARBONPLAN
READ OUR TERMS
X,Y: 0000,0000
2b7578a