0.1.7 • Published 6 years ago

vue-d3-sparkline v0.1.7

Weekly downloads
34
License
-
Repository
github
Last release
6 years ago

vue-sparkline

A D3 sparkline component for vue.

Demo

Installation

npm i vue-d3-sparkline

Basic usage

import SparkLine from "vue-d3-sparkline";
<SparkLine :data="data" /> 

Data format

Standard

data = [{x: <number>, y: <number>}, ...]

Custom

different object form:

dataCustom = [{xval: <number>, value: <number>}, ...]
xAccessor = d => d.xval
yAccessor = d => d.value

or as an array of arrays:

dataCustom = [[<number>, <number>], ...]
xAccessor = d => d.[0]
yAccessor = d => d.[1]
<Sparkline :data="dataCustom" :x-accessor="xAccessor" :y-accessor="yAccessor" />

Properties

proptyperequireddefault value
dataArray(Object)false (but really, should have some data)[]
showPointsbooleanfalsefalse
xAccessorfunctionfalsed => d.x
yAccessorfunctionfalsed => d.y
displaystring ('inline', 'fill', 'newline')false'inline'
heightnumberfalse16
aspectRationumberfalse5
responsivebooleanfalsefalse
0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago