Git Product home page Git Product logo

vue-chartjs's Introduction

vue-chartjs

vue-chartjs logo

vue-chartjs is a wrapper for Chart.js in Vue. You can easily create reuseable chart components.

Supports Chart.js v4.

npm version codecov Build Status Package Quality npm Gitter chat license CDNJS version Known Vulnerabilities Donate ko-fi


Install   •   How to use   •   Docs   •   Slack   •   Stack Overflow

Quickstart

Install this library with peer dependencies:

pnpm add vue-chartjs chart.js
# or
yarn add vue-chartjs chart.js
# or
npm i vue-chartjs chart.js

Then, import and use individual components:

<template>
  <Bar :data="data" :options="options" />
</template>

<script lang="ts">
import {
  Chart as ChartJS,
  Title,
  Tooltip,
  Legend,
  BarElement,
  CategoryScale,
  LinearScale
} from 'chart.js'
import { Bar } from 'vue-chartjs'

ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend)

export default {
  name: 'App',
  components: {
    Bar
  },
  data() {
    return {
      data: {
        labels: ['January', 'February', 'March'],
        datasets: [{ data: [40, 20, 12] }]
      },
      options: {
        responsive: true
      }
    }
  }
}
</script>

Need an API to fetch data? Consider Cube, an open-source API for data apps.


supported by Cube

Docs

Build Setup

# install dependencies
pnpm install

# build for production with minification
pnpm build

# run unit tests
pnpm test:unit

# run all tests
pnpm test

Contributing

  1. Fork it ( https://github.com/apertureless/vue-chartjs/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

This software is distributed under MIT license.

Buy Me A Coffee

vue-chartjs's People

Contributors

apertureless avatar renovate[bot] avatar thabarbados avatar dangreen avatar renovate-bot avatar euledge avatar nickknissen avatar ddbtrmatic avatar daniel-shuy avatar julienc91 avatar andreas83 avatar dakotawray2 avatar dood- avatar francescomussi avatar gcoguiec avatar zupolgec avatar mikeybeck avatar rotzbua avatar linusborg avatar timibadass avatar devnll avatar greenkeeper[bot] avatar k-rumi avatar amadeann avatar music-mind avatar payalord avatar beomi avatar tonpc64 avatar clarkdo avatar cormacrelf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.