A VueJS pie and donut chart component, utilizing CSS3 conic gradients with minimal markup and calculations created by Martin Ivanov
> Pie and donut chart component for VueJs based on CSS3 conic gradients, created by Martin Ivanov.
https://vc-piechart.wemakesites.net
`
$ npm i vc-piechart --save
`
// in main.js, use globally
import VcPiechart from 'vc-piechart'
import 'vc-piechart/dist/lib/vc-piechart.min.css'
Vue.use(VcPiechart)
// as a component in another component
import VcPiechart from 'vc-piechart'
import 'vc-piechart/dist/lib/vc-piechart.min.css'
export default {
name: 'app',
components: {
VcPiechart
}
}
`
``
``
- data (Array): chart data (default: []):
`javascript`
[
{
"color": "#f44336",
"value": 100,
"label": "Red"
},
{
"color": "#ff9800",
"value": 123,
"label": "Orange"
},
{
"color": "#4caf50",
"value": 456,
"label": "Green"
}
]
- size (String): chart's height and width in px, em, etc. default: 256px
- legend (Boolean): toggle chart's legend element (default: true)
- title (String): optional chart title (default: null)
- donut (Boolean): toggle the donut mode (default: false)
- flat (Boolean): toggle chart's drop-shadow (default: false)
https://bitbucket.org/acidmartin/vc-piechart/
` bashinstall dependencies
npm install
For detailed explanation on how things work, checkout the guide and docs for vue-loader.
Created by Martin Ivanov.