Skip to content

Line Chart ^0.1.15 ​

A lightweight, animated SVG line chart. Single or multi-series, optional area fill, smooth curves, step mode, reference lines, value labels, gradient strokes, hover tooltip, live updates — no external chart library.

Basic ​

8.1622.083649.9263.84JanFebMarAprMayJunJulAugSepOctNovDec
vue
<script setup>
import { VxLineChart } from 'veloxui'

const data = [12, 19, 14, 24, 30, 22, 35, 40, 38, 52, 48, 60]
const labels = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
</script>

<template>
  <VxLineChart :data="data" :labels="labels" :height="260" />
</template>

Multi-series with legend ​

7.9229.965274.0496.08JanFebMarAprMayJunJulAugSepOctNovDec
Revenue
Costs
Profit
vue
<VxLineChart :data="multiSeries" :labels="labels" legend />

Smooth vs Straight vs Step ​

Smooth
8.1622.083649.9263.84JanFebMarAprMayJunJulAugSepOctNovDec
Straight
8.1622.083649.9263.84JanFebMarAprMayJunJulAugSepOctNovDec
Step
8.1622.083649.9263.84JanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxLineChart :data="data" :labels="labels" />                  <!-- smooth -->
<VxLineChart :data="data" :labels="labels" :smooth="false" />  <!-- straight -->
<VxLineChart :data="data" :labels="labels" step />             <!-- step -->

Reference lines ^0.1.15 ​

Annotate thresholds, targets, or averages with horizontal reference lines.

8.1622.083649.9263.84TargetMinimumJanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxLineChart
  :data="data"
  :labels="labels"
  :references="[
    { value: 50, label: 'Target',  color: '#22c55e' },
    { value: 20, label: 'Minimum', color: '#ef4444' },
  ]"
/>

Value labels ^0.1.15 ​

Show the actual numeric value above each point.

1.792.924.055.186.312.12.42.63.23.84.14.44.24.95.35.76JanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxLineChart :data="data" :labels="labels" valueLabels dots color="#22c55e" />

Gradient stroke ^0.1.15 ​

8.1622.083649.9263.84JanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxLineChart :data="data" :labels="labels" gradient :stroke-width="3" color="#a855f7" />

Dashed line ^0.1.15 ​

Useful for forecasts or projected ranges.

8.1622.083649.9263.84JanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxLineChart :data="forecast" :labels="labels" dashed :area="false" />

Comparison: Current vs Prior period ​

24.444.76585.3105.6JanFebMarAprMayJunJulAugSepOctNovDec
2025
2024
vue
<VxLineChart
  :data="[
    { name: '2025', data: currentYear },
    { name: '2024', data: priorYear },
  ]"
  :labels="labels"
  :colors="['#6366f1', '#94a3b8']"
  legend
/>

With dots ​

8.1622.083649.9263.84JanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxLineChart :data="data" :labels="labels" dots />

No area fill ​

8.1622.083649.9263.84JanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxLineChart :data="data" :labels="labels" :area="false" dots />

Negative values ​

-14.56-5.28413.2822.56Break-evenJanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxLineChart
  :data="[-8, -2, 4, 10, 6, -4, -12, -6, 2, 14, 20, 16]"
  :labels="labels"
  color="#ef4444"
  :references="[{ value: 0, label: 'Break-even' }]"
/>

Large dataset (60 points) ​

9.821.43344.656.201234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
vue
<VxLineChart :data="bigDataset" :stroke-width="1.8" color="#06b6d4" />

Sparkline mode ​

No grid, no axes, no tooltip — just a tiny trend line. Great inside cards and tables.

Visitors
12,480
vue
<VxLineChart
  :data="sparklineData"
  :height="50"
  :grid="false"
  :axis="false"
  :tooltip="false"
  color="#22c55e"
/>

Dashboard card with target ​

Monthly conversions
6.0%
▲ 0.3% vs target
ON TRACK
1.792.924.055.186.31TargetJanFebMarAprMayJunJulAugSepOctNovDec

Interactive — Single color ​

#6366f1
#6366f1
8.1622.083649.9263.84JanFebMarAprMayJunJulAugSepOctNovDec

Interactive — Multi-series palette ​

#6366f1
Revenue
#22c55e
Costs
#f59e0b
Profit
7.9229.965274.0496.08JanFebMarAprMayJunJulAugSepOctNovDec
Revenue
Costs
Profit

Live / reactive ​

The chart smoothly tweens between states when the data prop changes.

16.2422.622935.3841.760123456
vue
<script setup>
import { ref, onMounted, onBeforeUnmount } from 'vue'
import { VxLineChart } from 'veloxui'

const live = ref([20, 24, 18, 30, 28, 35, 40])
let t
onMounted(() => {
  t = setInterval(() => {
    const next = Math.max(5, Math.min(80, live.value.at(-1) + (Math.random() - 0.5) * 20))
    live.value = [...live.value.slice(1), Math.round(next)]
  }, 1500)
})
onBeforeUnmount(() => clearInterval(t))
</script>

API ​

VxLineChart Props ​

PropTypeDefaultDescription
datanumber[] | LineChartPoint[] | LineChartSeries[][]Single or multi-series data
labels(string|number)[][]X-axis labels
heightnumber240Chart height
smoothbooleantrueSmooth cubic bezier curves
stepbooleanfalseStep-line mode
dashedbooleanfalseDashed stroke (e.g. forecasts)
gradientbooleanfalseHorizontal gradient stroke
areabooleantrueGradient area fill
dotsbooleanfalseDot at each point
valueLabelsbooleanfalseShow value text above each point
referencesLineChartReference[][]Horizontal threshold lines { value, label?, color?, dashed? }
colorstring—Single-series color
colorsstring[]—Multi-series palette
strokeWidthnumber2Line thickness
gridbooleantrueHorizontal grid
axisbooleantrueAxis labels
tooltipbooleantrueHover tooltip
legendbooleanfalseLegend below chart
animatebooleantrueAnimate on mount and data change
animationDurationnumber900Tween duration in ms
min / maxnumberautoForce y-axis bounds
yTicksnumber4Horizontal grid / tick count
formatValue(v) => stringabbreviates 1.2kValue formatter

Events ​

EventPayload
hover{ seriesIndex, pointIndex, value }
click{ seriesIndex, pointIndex, value }