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-in-chart

v0.0.1

Published

A Vue component to draw small charts in and in tables

Downloads

6

Readme

Build Status Coverage Status

vue-in-charts

Small Vue component to build simple small charts. Intended to be placed inline boxes and tables. :bar_chart: :chart_with_upwards_trend:

Install

Install via npm:

$ npm install vue-in-chart

Install via bower:

$ bower install vue-in-chart

Usage

Import the chart you want to use

import InPieChart from 'vue-in-charts';

Use it on your template. Below you can find the options for each chart.

<in-pie-chart
    :slices="[
            { name: 'Slice 1', value: 90, color: '#F44336' },
            { name: 'Slice 2', value: 70, color: '#2196F3' },
            { name: 'Slice 3', value: 50, color: '#8BC34A' },
            { name: 'Slice 4', value: 20, color: '#FFC107' }
        ]"
    :diameter="'100'" />

Properties

Pie Chart (InPieChart)

| Property | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | diameter | String | false | '100%' | The diameter of the pie. In other words, its width and height. | | rotate | Number | false | -90 | The rotation of the pie. -90 means the first slice will start at 90º | | slices | Array (of slice) | true | | An array of objects. Each one representing a slice of the pie. | | slice.name | String | false | | The name of the slice. Will be displayed on hovering the chart | | slice.value | Number | true | | The value of the slice. Will be displayed on hovering the chart and also will be used to calculate the percentage | | slice.color | String | true | | Will be used to fill the slice with the color. |

Line Chart (InLineChart)

| Property | Sub-Prop | Type | Required | Default | Description | | --- | --- | --- | --- | --- | --- | | width | | String | false | '250' | The width of the chart. | | height | | String | false | '100' | The height of the chart. | | show-points | | Boolean | false | true | Weather or not the points should be drawn. | | min-y | | Number | false | null | The minimum value for the Y axis. If none is passed, the smaller value will be used. | | max-y | | Number | false | null | The maximum value for the Y axis. If none is passed, the greater value will be used. | | show-tooltip | | Boolean | false | true | Wether to show or not the tooltip on hover | | lines | | Array (of line) | true | | An array containing the several lines and its properties. A line is defined as below | | line | | Object | true | | Object that defines a line. Should be used in am array with the lines property above. | | | data | Array (of numbers) | | | An array of numbers representing the Y axis values for the line. | | | pointRadius | Number | false | 3 | The radius of the point on this line. Only applicable if show-points is true. | | | pointColor | String | false | white | The color for the points of this line. Only applicable if show-points is true | | | strokeWidth | Number | false | 2 | The stroke width for this line. | | | strokeColor | String | true | | A color string fpr the line color. | | | fillColor | String | false | | A color string representing the color of the area below the line. | | | fillColor | Array | false | | An array of color strings representing the gradient of the area below the line. | | | fill-color| Object | false | | An object that defines the gradient for the fill color. The properties are listed as follow. | | | .x1 | String | true | | The x1 coordinate for the SVG direction. | | | .x2 | String | true | | The x2 coordinate for the SVG direction. | | | .y1 | String | true | | The y1 coordinate for the SVG direction. | | | .y2 | String | true | | The y2 coordinate for the SVG direction. | | | .stops | Array (of stop) | true | | An array of stops. | | | .stop.offset | String | true | | Percentage of the gradient. | | | .stop.color | String | true | | Color of the stop. |

Bar Chart (InBarChart)

| Property | Sub-Prop | Type | Required | Default | Description | | --- | --- | --- | --- | --- | --- | | width | | String | false | '250' | The width of the chart. | | height | | String | false | '100' | The height of the chart. | | min-y | | Number | false | null | The minimum value for the Y axis. If none is passed, the smaller value will be used. | | max-y | | Number | false | null | The maximum value for the Y axis. If none is passed, the greater value will be used. | | show-tooltip | | Boolean | false | true | Wether to show or not the tooltip on hover. | | stroke-width | | Number | false | 1 | The stroke width for the bars. | | stroke-color | | String | false | #333 | The stroke color for the bars. | | padding | | Number | false | 0 | The padding among the bars. | | fill-color | | String | false | tomato | The general color for each bar. | | fill-color | | Array | false | | An array of string of colors. The colors will be drawn as a vertical gradient. | | fill-color | | Object | false | | An object that defines the gradient for the fill color. The properties are listed as follow. | | | .x1 | String | true | | The x1 coordinate for the SVG direction. | | | .x2 | String | true | | The x2 coordinate for the SVG direction. | | | .y1 | String | true | | The y1 coordinate for the SVG direction. | | | .y2 | String | true | | The y2 coordinate for the SVG direction. | | | .stops | Array (of stop) | true | | An array of stops. | | | .stop.offset | String | true | | Percentage of the gradient. | | | .stop.color | String | true | | Color of the stop. | | bars | | Array (of numbers) | true | | Array of numbers representing the values for the bars | | bars | | Array (of objects) | true | | Array of objects representing the values for the bars. A bar is defined as below | | bar | | Object | | | Object that defines a bar. Should be used in am array with the bars property above. | | | value | Number | true | | The value for the bar. | | | fill-color | | | | This is a specific color for the bar. It overrides the fill-color property above and accept any format as described above |