npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-bar-graph

v2.1.0

Published

Simple and lightweight Vue chart svg component without chart library dependencies

Downloads

5,383

Readme

Vue Bar Graph

A simple and lightweight Vue.js 3 component for making charts that do not rely on large chart libraries and will not bloat your dependencies.

For Vue.js 2.x use 1.x version.

Forked from https://github.com/djaxho/pure-vue-chart


Example

<vue-bar-graph
  :points="[3,5,2,5,4]"
  :width="400"
  :height="200"
/>

charts

When props are updated the graph will automatically animate to the new values.

Install

npm i vue-bar-graph

Import it:

import VueBarGraph from 'vue-bar-graph';

Register it in your component:

components: {
    VueBarGraph,
},

Use it

<vue-bar-graph
  :points="[3,5,2,5,4]"
  :width="400"
  :height="200"
/>

Options

To further control the display of data, you can use simple props to manipulate the charts. Here are some examples:

examples

Most of the available props below are self-explanatory:

:points=[1,4,5,3,4]
:show-y-axis="false"
:show-x-axis="true"
:width="400"
:height="200"
:show-values="true"
:use-custom-labels="true"
:labels="['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dec']"

Additional Features

Trendline

You can add a simple linear trend line by using the following props:

:show-trend-line="true"
:trend-line-width="2"
trend-line-color="lightblue"

trendline

X-axis labels

X-axis labels, by default will be from 1 - length-of-data. But you can automatically use custom labels by using the prop :use-custom-labels="true". Or you can provide the data as an array of objects, each with a value and label like so:

:points=[{label: 'N', value: 41.1}, {label: 'NW', value: 1}, {label: 'W', value: 15}]

Contributing

I'm open to any issues or pull requests so long as they are simple, easy to read, use the eslint settings in package.json, and follow commitizen-esque style commit formats. Just open an issue on github and start a discussion.

Authors or Acknowledgments

  • Danny Jackson
  • Lauris BH

List of features

  • Simple bar charts

License

This project is licensed under the MIT License but please create pull requests to improve this package together rather that copying into another project.