Vue Bar Graph is a lightweight and simple SVG component designed for creating interactive bar charts within Vue.js applications without introducing heavy third-party charting libraries. This approach significantly minimizes bundle size and external dependencies, making it ideal for projects where performance and a small footprint are critical. The current stable version, 2.2.0, is specifically built for Vue.js 3, with older 1.x versions available for Vue.js 2.x projects. The package provides features such as automatic animation on prop updates, configurable custom labels for both X and Y axes, value display, and an optional linear trendline. Its release cadence is moderate, focusing on stability, bug fixes (like reactivity issues in v2.2.0), and dependency updates, following a major migration to Vue 3 in v2.0.0. It differentiates itself through its minimalist design and direct Vue integration, avoiding the overhead of larger charting ecosystems.
npm install vue-bar-graphVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to integrate `vue-bar-graph` into a Vue 3 Single File Component (SFC) using the Composition API. It showcases defining data points with custom labels, setting dimensions, enabling value display, adding a trend line, and dynamically updating the chart data, which triggers automatic animations.
For Vue 2 projects, install `npm i vue-bar-graph@^1.0.0`. For Vue 3 projects, ensure you are using `vue-bar-graph` version 2.x or higher.
Upgrade to version 2.2.0 or later to benefit from the fix for deep watching on the `points` prop. Alternatively, ensure your `points` data is immutably updated for Vue's reactivity system.
Review your charts after upgrading to v2.1.0 to ensure animations behave as expected. If specific animations are missing, you may need to implement them custom or explore alternatives.
Ensure `VueBarGraph` is listed in the `components` option of your Vue component, or registered globally via `app.component('VueBarGraph', VueBarGraph)` if using a global instance.If your project is Vue 2, downgrade to `vue-bar-graph` version 1.x using `npm i vue-bar-graph@^1.0.0`. If you intend to use Vue 3, ensure your project is properly migrated to Vue 3.
First, install the package using `npm i vue-bar-graph` or `yarn add vue-bar-graph`. Then, verify that the import statement `import VueBarGraph from 'vue-bar-graph';` is correctly spelled and placed.
No dependency data recorded yet.