Skip to content

Line Chart

Last updated 12 Nov 2026

NbLineChart plots one or more numeric series along a shared X dimension, typically time or any ordered category.

Formatting values ​

Values of 1000 or more print as 1.2k by default. valueFormatter replaces that on the axis and in the tooltip, and a point's label, when it has one, is shown in the tooltip instead of its value.

vue
<template>
  <NbLineChart :series="series" :value-formatter="formatUsers" />
</template>

<script setup lang="ts">
const users = new Intl.NumberFormat('en-GB')
const formatUsers = (value: number) => `${users.format(value)} users`
</script>

Props ​

PropTypeDefaultDescription
seriesIChartSeries[][]One or more named series of { x, y } data points
titlestring-Chart title
subtitlestring-Secondary descriptive line
heightnumber | string280Container height
areabooleanfalseRender filled area under each line
pointsbooleanfalseRender a circle at each data point
curve'linear' | 'smooth' | 'step''smooth'Path interpolation
showLegendbooleantrueRender a legend below the chart
showTooltipbooleantrueShow hover tooltip with vertical guide
showGridbooleantrueRender Y-axis gridlines
colorsstring[]default palettePer-series colors
valueFormatter(value: number) => string1.2k shorthandFormats axis ticks and tooltip values
animatebooleanfalseDraw the lines in on first render and on data change

Entrance animation ​

animate draws each line in from the left when the chart first renders and again when its data changes. An area fill and the points fade in once the line is under way. It is off by default and is switched off entirely under prefers-reduced-motion: reduce.

vue
<NbLineChart animate :series="series" />

Notes ​

  • The X dimension is treated as ordinal, points are spaced evenly along the X axis, regardless of the underlying value. Use the order of data to control point sequence.
  • All series should share the same X-value sequence (the first series defines the X-axis labels).
  • For cumulative / area mode, ensure your data is sorted ascending on X.