Observed since 20 Oct, 22:15 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0saw/vue-css-donut-chart
Lightweight Vue component for drawing pure CSS donut charts
Lightweight Vue component for drawing pure CSS donut charts
Live demo can be found on the project page - https://dumptyd.github.io/vue-css-donut-chart
yarn or npmyarn add vue-css-donut-chart
OR
npm install vue-css-donut-chart
vue-css-donut-chartimport Donut from 'vue-css-donut-chart';
import 'vue-css-donut-chart/dist/vcdonut.css';
Vue.use(Donut);
<link href="https://unpkg.com/vue-css-donut-chart/dist/vcdonut.css">
<script src="https://unpkg.com/vue-css-donut-chart"></script>
<script>
Vue.use(vcdonut.default);
</script>
With sane defaults in place, basic usage is as simple as passing a sections array of objects with a value prop to vc-donut component.
<template>
<vc-donut :sections="sections">50%</vc-donut>
</template>
<script>
export default {
data() {
return {
sections: [{ value: 25 }, { value: 25 }, { value: 25 }, { value: 25 }]
};
}
};
</script>
<template>
<vc-donut
background="white" foreground="grey"
:size="200" unit="px" :thickness="30"
has-legend legend-placement="top"
:sections="sections" :total="100"
>
<h1>100%</h1>
</vc-donut>
</template>
<script>
export default {
data() {
return {
sections: [
{ label: 'Red section' value: 25, color: 'red' },
{ label: 'Green section' value: 25, color: 'green' },
{ label: 'Blue section' value: 25, color: 'blue' }
]
};
}
};
</script>
sizeNumber250unitStringpxsize. Can be any valid CSS unit. Use % to make the donut responsive.thicknessNumber20textStringbackgroundString#ffffffforegroundString#eeeeeetotalNumber100has-legendBooleanfalselegend-placementStringbottomtop, right, bottom and left.sectionsArray[]value property. Sum of all the sections' value should not exceed total, an error is thrown otherwise.value - Size of the section. Should be <= total.color - Color of the section. vc-donut comes with 24 predefined colors, so this property is optional if you have <= 24 sections without the color property.label - Name of this section. This is used in the legend as well as tooltip text.If you want more control over text content of the chart, default slot can be used instead of the text prop.
legendSlot for plugging in your own legend.
Code released under MIT license.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
vueEnvironment{
"local_name": "vue",
"alias": false,
"peer_metadata": null
} | ^2.5.17 | runtime |
devEnvironment{
"local_name": "dev",
"alias": false,
"peer_metadata": null
} | ^0.1.3 | development |
@vue/cli-plugin-babelEnvironment{
"local_name": "@vue/cli-plugin-babel",
"alias": false,
"peer_metadata": null
} | ^3.0.3 | development |
@vue/cli-plugin-eslintEnvironment{
"local_name": "@vue/cli-plugin-eslint",
"alias": false,
"peer_metadata": null
} | ^3.0.3 | development |
@vue/cli-serviceEnvironment{
"local_name": "@vue/cli-service",
"alias": false,
"peer_metadata": null
} | ^3.0.3 | development |
vue-template-compilerEnvironment{
"local_name": "vue-template-compiler",
"alias": false,
"peer_metadata": null
} | ^2.5.17 | development |
eslint-config-airbnb-baseEnvironment{
"local_name": "eslint-config-airbnb-base",
"alias": false,
"peer_metadata": null
} | ^13.1.0 | development |
eslint-plugin-importEnvironment{
"local_name": "eslint-plugin-import",
"alias": false,
"peer_metadata": null
} | ^2.14.0 | development |
Source distribution
{
"integrity": "sha512-qqrQPKxNEZMbeN+gwDJwvURJKxEIIS5xJZFj2mJhKxv+WOLdbZqwWIwVCzGiLXQoxYn6Q1+bFUHLRGnqekom0g==",
"shasum": "3f81d4411f1c97db424e103429e0e52f7c90fb32",
"tarball": "https://registry.npmjs.org/@0saw/vue-css-donut-chart/-/vue-css-donut-chart-1.1.0.tgz",
"fileCount": 24,
"unpackedSize": 420057,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcj0hfCRA9TVsSAnZWagAAE3EP/ArvsUWMJpY+EiyOJ0Lx\nz9xEu9+W0Zip679uQ+4TXc1+C2HGGL5WNarhCCwXehYcDD1gGlRXUjlUKz2c\nGo4xdhaL4r0g9/pv0Ms2ulxN60THIiLF9Msp5/73THSIt3YXELofL1r7cUku\narSVkjP/QFFzU/FAdbWxjcTgYKicGXfiIeuXgICLCX0jIhuVe3WEu+C8Vyes\nlcX3I+valYlIMX5HYbhuOgbJpzvUJ8R11GTuReXavPFCvJj6dveOdErZ7PKU\n1Z1lgcfScNwI8m6soWwqMkVZ0t8N8a8wf+ojc4n61CEHsX1YuaWT0VkTzOfL\nGvPKviRA35JM5X+dscXe8ZdVu3b9pKni7QYBH+1z4APC9KC/TY5/kBzxsDlL\nCbYe0EID3POKDqiiUJfaRCM2I+/o8G2Yqvr8ClBrPT1eitIhyqkB1Fx56Sno\n0Cu4d85xS0J4esHtfyIMMQuHRQalTkCIOpaAfdIKmMjzNVZgpbfEMAJFk8Yk\nUs6Cbeac710tfJiR1cGxlONBJUGF99/jYhCpnsWpHseEzDC02jJOyMCDLydq\nP4BZnsc9ALGnLpbBorNcgMDirzYTi4DAeXmrJDkH8vlX5GiOYaUWcKP9Viaw\nuhp4zea2oo4TwqerhjksloZM3x/6mT3aFpLVQ/gWuROG1SCCiSUT9OTLeiNs\npuBh\r\n=I3i6\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEYCIQDGBcsxQjFnCNVtu1cWkXcUr+9VvopzYmRyBip74hXcQAIhAPRCdVw/u7dhZUm1wJoI/ChmCBiNVcViGy3V9UZXJkFg"
}
]
}Observed since 20 Oct, 22:15 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:d46b04da2139706eebec09b7163a95dd85dade46e5ffd5ccf74d5159654a20a1