vue-css-donut-chart is a lightweight Vue component designed for creating highly customizable donut charts using pure CSS. Targeting Vue 3 environments (current stable version 2.1.0), it provides a flexible solution for visualizing data slices without relying on external SVG or Canvas libraries. The package maintains an active development status, with a clear separation for Vue 2 support (version 1.x), ensuring compatibility across major Vue ecosystems. Key differentiators include its minimal bundle size, pure CSS rendering for performance and ease of styling, and an extensive API for controlling chart appearance, including thickness, colors, legend placement, and responsiveness. It also supports conversion to a pie chart by adjusting the `thickness` prop and offers various interaction events for individual sections.
npm install vue-css-donut-chartVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `VcDonut` component with a comprehensive set of props, including custom colors, sizes, legend, and event handling. It sets up three colored sections and logs interaction events.
For Vue 2 projects, install version 1.x: `npm install vue-css-donut-chart@^1` or `yarn add vue-css-donut-chart@^1`.
If inner content is crucial, avoid `thickness: 100`. Instead, use a value slightly less than 100 or position the content outside the donut component itself if a perfect pie chart look is desired with visible inner content.
Ensure you are using `import { VcDonut } from 'vue-css-donut-chart';` in your component's script section or `app.use(vcdonut.default)` if using the UMD build in a browser.Verify your Vue version and install the corresponding `vue-css-donut-chart` version (v1.x for Vue 2, v2.x for Vue 3). If using UMD, ensure you call `app.use(vcdonut.default)`.