@tygr/vue-pie-chart

Pie chart
709
Install
npm install @tygr/vue-pie-chart
Latest Version:1.0.7
Vue:2
License:ISC
Last Updated:Jan 6, 2023
Links: GitHub  ·  npm
Maintainer: jg83

Vue Pie Chart

Build Status

DEMO

A simple no-nonsense pie chart optimized for VueJS

demo

Installation

Yarn

yarn add -D @tygr/vue-pie-chart
import PieChart from '@tygr/vue-pie-chart'

export default {
  components: {
    PieChart,
  }
}

Browser

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/@tygr/vue-pie-chart/dist/vue-pie-chart.min.js" charset="utf-8"></script>
<script>
  Vue.use(PieChart)
</script>
  • Charset attribute required

Usage

<pie-chart :plot="plot"></pie-chart>
export default {
  data: () => ({
    plot: [
      {
        value: 10,
        color: 'blue',
        label: 'Blue amount',
        id: 1
      },
      {
        value: 45,
        color: 'green',
        label: 'Green amount',
        id: 2
      },
      {
        value: 30,
        color: 'purple',
        label: 'Purple amount',
        id: 3
      }
    ]
  })
}

Events

event payload description
click any Emits the id of a datum when clicked

Props

prop type default description
plot array [] The plot data to show
background-color string 'grey' The background color
color string 'white' Text and border color

Datum properties

prop type description
value number percentage out of 100
color string background color for the circle segment
label string label for the segment
id any Identifier to be used for the click event

Related Packages

v-easy-chart

vuejs charts library demo

829 1
@justeattakeaway/pie-icons-vue

PIE Design System Icon set for Vue

276,249 42
pie
detect-touch-device

Javascript library to detect touch friendly devices

62,595 4
@antv/f-vue

FEngine for Vue.js

7,809 7,994
@antv/f2-vue

F2 for Vue.js

4,606 7,994

Version History

Version Released Vue License
1.0.7 2 ISC
1.0.6 2 ISC
1.0.5 2 ISC
1.0.4 2 ISC
1.0.3 2 ISC