Chart line table — Charts block

Free

charts-chart-line-table · for app, analytics, billing pages

Chart line table

A trend over time for two or three series, with its figures beside it in a table

Documentation

Installation

One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).

pnpm dlx shadcn-vue@latest add @trame/charts-chart-line-table

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ChartsChartLineTable from '@/components/trame/blocks/charts/charts-chart-line-table.vue'

const props = {
title: "Revenue by channel",
subtitle: "May through October, in dollars",
reading: "Online sales have been growing since August, while markets are slowing as the season ends.",
headline: {
label: "6-month total",
value: "$45,860",
delta: "+8.1%",
deltaLabel: "vs. previous 6 months",
tone: "success"
},
series: [
{
id: "web",
label: "Online store",
points: [
{
x: "May",
y: 412000
},
{
x: "Jun",
y: 438000
}
]
},
{
id: "market",
label: "Markets",
points: [
{
x: "May",
y: 186000
},
{
x: "Jun",
y: 204000
}
]
}
],
options: {
yFormat: "money",
currency: "USD"
}
}
</script>

<template>
<ChartsChartLineTable v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordswhat the chart shows ("Revenue per month")
subtitlestringWordsthe period or the unit, one line
readingstringWordsone sentence reading the chart, written by the merchant or the host: the block never writes it
headlineHeadlinethe headline figure above the chart
series*Sery[]Datathe series over the same categories; amounts in cents when yFormat is money; at most 60 points (downsample on the server)
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Headline headline · 5 props
PropTypeDescription
label*stringWordswhat the figure is ("Total over 6 months")
value*stringWordsthe figure, formatted by the host
deltastringWordsits change, formatted and signed by the host ("+8.1%")
deltaLabelstringWordswhat it compares to ("vs previous period")
tone'neutral' | 'success' | 'warning' | 'danger'how the host reads the change
Sery series[] · 3 props
PropTypeDescription
id*stringDesignthe series’ key
label*stringWordswhat the series counts ("Online shop")
points*Point[]the series’s points, in order
Point series[].points[] · 2 props
PropTypeDescription
x*stringWordsthe category or period ("May")
y*number | nullthe value at this point; null when unknown
Options options · 5 props
PropTypeDescription
yFormat'number' | 'money' | 'percent'how the values read: a number, money (cents) or a percent
currencystringDesignISO 4217 for money, the app’s by default
showTable'visible' | 'screen-reader'the text table: visible beside the chart or for screen readers only
emptystringWordswhat a chart with no data says
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
What it asks your app for

The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
moneyformats a price, given in cents
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour word for an interface key, or undefined to keep the block’s own

The words it says itself, in English and French; label(key) replaces any of them:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo many attempts, try again in a moment.Trop de tentatives, réessayez dans un moment.

Features

  • Every word in the server HTML
  • Same markup in Vue and React
  • Theme tokens only: every theme, light and dark
  • Shows what you give it, invents nothing
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Reads series from your app

A charts section, for app, analytics, billing pages; it uses @lucide/vue.

More charts blocks

  • Heatmap dots: a quiet field of dots sized and shaded by value, for long periods read at a glance: occupancy, activity per day or per slot.
  • Heatmap matrix: a labelled grid with each value written in its shaded cell: cohorts and retention, hours by weekday, when the exact numbers are read.
  • Heatmap ranked rows: the rows sorted by their total, each one a thin strip of its cells, when which row leads matters more than the columns.
  • Key metrics featured: The merchant’s own primary metric takes the lead beside a quiet list of supporting measures.
  • Key metrics tiles: Centered figures on generous tiles for the merchant’s own headline measures, with context beneath.
  • Metric grid ruled grid: an analytics page of the host’s own measures over a chosen period: one ruled grid of chart tiles sharing their borders, the first metric leading at two thirds, each with its value, this period against the previous and an area chart.
  • Spend trend stacked bars: a plan with variable spend: three figures and a stacked bar chart of what each period cost.
  • Stat cards linked: figures about goals or finance, each with a status line that leads to the detail.

All 20 charts blocks