home / skills / dennisadriaans / vue-chrts / vue-charts-overview
This skill provides overview of vue-chrts and nuxt-charts, including installation, components, and usage guidance for Vue 3 charts.
npx playbooks add skill dennisadriaans/vue-chrts --skill vue-charts-overviewReview the files below or copy the command above to add this skill to your agents.
---
name: vue-chrts-overview
description: Overview of vue-chrts and nuxt-charts libraries. Use when the user asks about available charts, installation, or general library capabilities.
---
# Vue-Chrts / Nuxt-Charts Overview
vue-chrts is a Vue 3 charting library inspired by Tremor, built on Unovis. nuxt-charts is its Nuxt module wrapper.
## Quick Mental Model
Think of vue-chrts like a **restaurant menu**: you pick a chart type (the dish), provide your data (ingredients), and configure categories (the presentation). The library handles the cooking (rendering).
## Installation
```bash
# Vue.js
pnpm add vue-chrts
# Nuxt
pnpm add nuxt-charts
# Add to nuxt.config.ts: modules: ["nuxt-charts"]
```
## Available Chart Components
```
┌─────────────────────────────────────────────────────────────┐
│ CHART COMPONENTS │
├─────────────────────────────────────────────────────────────┤
│ TIME SERIES │ COMPARISON │ RELATIONSHIPS │
│ ───────────── │ ────────── │ ───────────── │
│ • LineChart │ • BarChart │ • SankeyChart │
│ • AreaChart │ • DonutChart │ • DagreGraph │
│ • DualChart │ • BubbleChart │ │
│ │ │ │
├──────────────────────┼────────────────────┼─────────────────┤
│ SPECIALIZED │ MAPS │ │
│ ─────────── │ ──── │ │
│ • GanttChart │ • TopoJSONMap │ │
│ │ • DottedMap │ │
└──────────────────────┴────────────────────┴─────────────────┘
```
## Core Pattern for ALL Charts
Every chart follows this structure:
```vue
<template>
<ChartComponent
:data="dataArray"
:categories="categoriesObject"
:height="number"
:xFormatter="formatterFunction"
<!-- ...other props -->
/>
</template>
<script setup>
// 1. Your raw data array
const data = [{ label: 'A', value1: 10, value2: 20 }, ...]
// 2. Categories define which data keys to plot and how they look
const categories = {
value1: { name: 'Display Name', color: '#hexcolor' },
value2: { name: 'Another Series', color: '#hexcolor2' }
}
// 3. Formatter to display x-axis labels
const xFormatter = (tick) => data[tick].label
</script>
```
## Key Imports
```typescript
// Components
import {
LineChart, AreaChart, BarChart, DonutChart,
BubbleChart, GanttChart, DagreGraph, DualChart,
SankeyChart, TopoJSONMap, DottedMap
} from 'vue-chrts';
// Enums & Types
import {
LegendPosition, // TopLeft, TopCenter, TopRight, BottomLeft, BottomCenter, BottomRight
CurveType, // Linear, MonotoneX, Step, Natural, Basis, Cardinal, etc.
Orientation, // Horizontal, Vertical
DonutType // Half, Full
} from 'vue-chrts';
```
## Common Gotcha
**xFormatter receives an INDEX, not the data object!**
```typescript
// ❌ WRONG
const xFormatter = (d) => d.month
// ✅ CORRECT
const xFormatter = (tick) => data[tick].month
```
This skill provides a concise overview of the vue-chrts chart library and its Nuxt wrapper, nuxt-charts. It highlights available chart components, installation steps, the common component pattern, and important gotchas for Vue 3 projects. Use it to quickly determine if vue-chrts fits your visualization needs and how to get started.
vue-chrts exposes a set of Vue 3 chart components built on Unovis, each expecting a data array, a categories definition that maps data keys to display names and colors, and optional props like height and formatters. nuxt-charts is a Nuxt module that registers the components and simplifies integration in Nuxt apps. All charts share the same usage pattern: pass data, categories, and formatting functions to the chosen ChartComponent.
How do I install for a plain Vue 3 project?
Install vue-chrts (pnpm add vue-chrts) and import the components you need into your app.
How do I add it to a Nuxt project?
Install nuxt-charts (pnpm add nuxt-charts) and add 'nuxt-charts' to the modules array in nuxt.config.ts.
What is the common chart prop pattern?
All charts accept :data (array), :categories (object mapping keys to display names/colors), :height (number), and formatter props like :xFormatter.
What common mistake should I avoid?
Do not treat xFormatter as a data object. It receives an index; use it to index into your data array (data[tick]).