Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
sparklines.js

README.md

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);
}