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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-naive-svg-chart

v1.4.7

Published

Vue.js components that draw naive svg charts

Readme

Introduction

A naive implementation of a few charts with Vue.js. The charts are created using HTML5 SVG.

Installation

npm install --save vue-naive-svg-chart

or

yarn add vue-naive-svg-chart

Usage

In script tag:

import Vnsc from 'vue-naive-svg-chart'
export default {
	components: {Vnsc},
	data () {
		return {
			lineData: [
				{data: [300, 86, 168, 201, 303, 365, 560], color: 'red', label: 'data1'},
				{data: [720, 513, 376, 54, 13, 21, 90], color: 'green', label: 'data2'},
				{data: [560, 319, 62, 75, 807, 497, 641], color: 'blue', label: 'data3'}
			],
			labels: [{
				value: 'Monday',
				popUp: 'Monday (New year)'
			}, 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
		}
	}
}

Then in the template:

<vnsc id="line-chart-1" type="line" :dataset="lineData" :labels="labels" />

props

props: {
	id: {type: String, required: true},
	type: {type: String, required: true},
	fontSize: {type: Number, default: 16},
	padding: {type: Number, default: 16},
	dataset: {type: Array, required: true},
	labels: {type: Array, required: true},
	showLegend: {type: Boolean, default: true},
	color: {type: String, default: '#000'},
	axesStrokeWidth: {type: Number, default: 2},
	stack: {type: Boolean, default: false},
	lineFill: {type: String, default: 'none'},
	lineFillOpacity: {type: Number, default: 0.6},
	animateClass: {type: String},
	showPopUp: {type: Boolean, default: true},
	popUpPadding: {type: Number, default: 16}
}
  • Available chart types are: 'line', 'column', and 'bar'.
  • 'column' and 'bar' charts can be stacked by setting 'stack' to 'true'
  • Legend can be hidden by setting 'showLegend' to 'false'
  • 'color' controls the colour of the axes and legend text
  • 'line' chart can have fill below the line by setting 'lineFill' to 'solid' or 'gradient'
  • Pop up can be hidden be setting 'showPopUp' to 'false'

class and id

  • Pop up rect has class name of "id+'-pop-up-rect'" where 'id' is the id of the chart
  • Line chart data point circle has id of "id+'-'+l.label+'-data-point-'+index" where 'id' is the id of the chart, 'l.label' is the label for that specific line, and 'index' is the index of that specific data point in the data array. For example, a line chart with id 'chart1' and one of the line has label 'line1', then the first data point circle will have id of 'chart1-line1-data-point-0'