X Enterprises
Chart

ChartLine

Line chart with configurable curve, axes, legend, and grid lines.

ChartLine

Lightweight wrapper around the Nuxt UI line chart primitive, normalizing prop names and setting sensible defaults. Renders multiple series via a categories map. Forwards unknown attributes to the underlying primitive via v-bind="$attrs".

Components

<XAChartLine />

Line chart with monotone curve, Y grid lines, and top-right legend by default.

<XAChartLine
  :data="[
    { date: 'Jan', revenue: 4200, expenses: 3100 },
    { date: 'Feb', revenue: 5800, expenses: 3400 },
  ]"
  :categories="{
    revenue: { name: 'Revenue', color: '#3b82f6' },
    expenses: { name: 'Expenses', color: '#ef4444' },
  }"
  :height="300"
  :line-width="2"
/>

Props

PropTypeDefaultDescription
dataany[]Required. Chart data array.
categoriesRecord<string, { name: string; color: string }>Required. Series definitions.
heightnumber300Chart height in px.
xFormatter(tick: number, i?: number) => stringCustom X-axis tick formatter.
yFormatter(tick: number, i?: number) => stringCustom Y-axis tick formatter.
curveTypeCurveTypeCurveType.MonotoneXLine interpolation.
hideLegendbooleanfalseHide the legend.
hideTooltipbooleanfalseHide the hover tooltip.
legendPositionLegendPositionLegendPosition.TopRightLegend placement.
yGridLinebooleantrueShow horizontal grid lines.
xGridLinebooleanfalseShow vertical grid lines.
hideXAxisbooleanfalseHide the X axis.
hideYAxisbooleanfalseHide the Y axis.
xLabelstringX-axis label.
yLabelstringY-axis label.
lineWidthnumber2Line stroke width in px.

AI Context

component: XAChartLine
package: "@xenterprises/nuxt-x-app"
auto-import: true
prefix: XA
use-when: Rendering a standalone time-series or trend line chart; prefer XACardRevenue or XACardSparkline when the chart should appear inside a card with a title and metric value
patterns:
  - categories is Record<key, { name, color }> where each key matches a data field.
  - Use xFormatter/yFormatter to map numeric tick indexes to data labels.
Copyright © 2026