Skip to content

Sparkline

Last updated 27 Oct 2026

NbSparkline is a tiny inline chart for embedding in dashboard tiles, table cells, and KPI widgets. It renders a single line with an optional gradient fill underneath, with no axes, labels, legend, or tooltip. The SVG uses viewBox with preserveAspectRatio="none" so it stretches to fill its container while the stroke stays visually consistent thanks to vector-effect="non-scaling-stroke".

vue
<template>
  <NbSparkline :data="series" />
</template>

<script setup lang="ts">
const series = [3, 5, 4, 7, 6, 9, 8, 10, 12, 11, 14, 13]
</script>

Inline in a KPI tile ​

Sparklines are designed to live inside other UI. They take 100 % of their parent width by default and the height you give them.

Without fill ​

Set fill to false for a clean line-only sparkline.

Straight segments ​

Set smooth to false to draw straight segments between points instead of smoothed cubic curves.

Stroke width ​