Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

Library to generate SVG sparklines

Demo

Usage

<script src="sparklines.js"></script>
<span class="sparkline" data-values="1,4,3,6,5"></span>
<span class="sparkline sparkline-filled" data-values="1,4,3,6,5"></span>

Anything with the sparkline class will get an SVG sparkline made from the values in data-values appended. Add the class sparkline‑filled for a filled sparkline like above.

It's not a bad idea to add style too:

.sparkline svg {
  stroke: mediumseagreen;
  stroke-width: 1.5px;
}
.sparkline-filled svg {
  fill: rgba(60,179,113,0.25);
}

About

SVG sparklines

Resources

Releases

No releases published

Packages

No packages published