@josquin2/nuxt-charts
nuxt-charts
Nuxt module for vue-chrts
Features
- 📊 Use beautiful chart components in your Nuxt applications
- 🔄 Auto-imports for all chart components
- 📊 Multiple types: Line, Bar, Area, Donut
- 🎨 Easily customizable
- 💡 Simple, intuitive API
- 🚀 Built with Vue 3 and TypeScript
Installation
# npm
npm install nuxt-charts
# yarn
yarn add nuxt-charts
# pnpm
pnpm add nuxt-charts
Usage
Add the module to your Nuxt config:
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["nuxt-charts"]
});
Then use the components in your Nuxt application:
<template>
<div class="chart-wrapper">
<LineChart
:data="data"
:categories="categories"
:height="300"
:xFormatter="xFormatter"
xLabel="Month"
yLabel="Amount"
/>
</div>
</template>
<script setup>
import { LineChart } from 'vue-chrts';
const data = [
{ month: 'Jan', sales: 100, profit: 50 },
{ month: 'Feb', sales: 120, profit: 55 },
{ month: 'Mar', sales: 180, profit: 80 },
{ month: 'Apr', sales: 110, profit: 40 },
{ month: 'May', sales: 90, profit: 30 },
];
const categories = {
sales: {
name: 'Sales',
color: '#3b82f6'
},
profit: {
name: 'Profit',
color: '#10b981'
}
};
const xFormatter = (i) => data[i].month;
</script>
Available Components
AreaChart- Area chartAreaStackedChart- Stacked area chartLineChart- Line chartBarChart- Bar chartDonutChart- Donut chart
Auto-imported Types
The following types are auto-imported:
LegendPositionCurveTypeOrientationBulletLegendItemInterface
License
MIT
Related Packages
vue-chrts
Vue 3 chart components built on Unovis — Area, Bar, Line, Donut, Sparkline and T...
692,258
439
@memotux/nuxt-vue-plot
Nuxt module for @memotux/vue-plot — declarative data visualization with Observab...
376
2
Version History
| Version | Released | License |
|---|---|---|
| 2.2.9 | MIT | |
| 2.2.8 | MIT | |
| 2.2.7 | MIT | |
| 2.2.6 | MIT | |
| 2.2.5 | MIT | |
| 2.2.3 | MIT | |
| 2.2.2 | MIT |