Vue Chrts - Charts for Vue 3

2.1.4 · active · verified Sun Apr 19

Vue Chrts (version 2.1.4, with recent releases indicating active maintenance) is a Vue 3 charting library designed to create beautiful, responsive data visualizations with minimal setup. Inspired by Tremor and built on top of Unovis, it offers a variety of chart types including Line, Bar, Area, Stacked Area, and Donut charts. Key differentiators include its intuitive API, full customizability, responsive design, and robust TypeScript support, making it well-suited for modern Vue.js and Nuxt 3 applications where aesthetic appeal and ease of integration are priorities. It handles the complexities of charting, allowing developers to focus on data presentation.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates importing and using the LineChart component within a Vue 3 `<script setup>` component, binding data, defining categories, and setting up axis formatters and labels. It illustrates a basic chart with two data series.

<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>

<template>
  <LineChart
    :data="data"
    :categories="categories"
    :height="300"
    :xFormatter="xFormatter"
    xLabel="Month"
    yLabel="Amount"
  />
</template>

view raw JSON →