Skip to content

YLabel ​

YLabel renders a rotated y-axis title as a DOM element. When it receives size directly, or gets one from TransformGroup, it uses the shared plot-layer classes and is absolutely positioned over the plot container like the SVG layers. Without a size, it renders as a normal DOM element and participates in the surrounding layout.

Import ​

ts
import { YLabel } from '@putianyi888/vue3-plots'

Example ​

vue
<YLabel :size="{ width: 640, height: 360 }">
  Value
</YLabel>

Props ​

PropTypeDefaultDescription
sizePlotSizeOuter SVG size in pixels.

Slots ​

SlotPropsDescription
defaultNoneLabel content.

Notes ​

The automatic absolute positioning is only a starting point. Because YLabel is regular DOM, you can omit size outside TransformGroup to place it in an external CSS grid or flex layout. See the responsive ResizeObserver example, where YLabel participates in DOM layout and the SVG plot measures the remaining area.