1.0.8 • Published 3 years ago

vue-chartjs3 v1.0.8

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

vue-chartjs-wrapper

A wrapper around the chart.js (version 3) library based on vue-chart.js

You can dynamically change the options, data or chart type, and the chart will update automatically update for you.

using the wrapper

You can import Chart and use it as a normal component in your vue app.

For the specific documentation about the library see: https://www.chartjs.org/

example

<template>
    <Chart :data="data" :options="options" :type="type" /> 
</template>

<script>
import Chart from 'vue-chartjs3'
   
export default {
    components: {
        Chart
    },
    data () {
        return {
              type: 'line',
              data: {
                labels: ["Car", "Bike", "Walk", "Boat", "Plane", "Anything else"],
                datasets: [
                  {
                    label: '# of Votes',
                    data: [12, 19, 3, 5, 2, 3],
                    backgroundColor: '#386380'
                  },	
                  {
                    label: '# of Points',
                    data: [7, 11, 5, 8, 3, 7],
                    backgroundColor: '#ff6384'
                  }
        		],
              },
              options: {
                responsive: true,
                maintainAspectRatio: false,
              }
        	}
    }
}
</script>
1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago