Using enableTagOptions with jQuery Sparkline

by gwatts

HTML

<script src="https://gwatts.com/jquery.sparkline/2.1.2/jquery.sparkline.js"></script>
<p>
Sparkline appears here: <span style="height: 400px; width: 400px;" id="sparkline" sparkSliceColors="[green,blue,#f8a]">1,2,3</span>
</p>

JavaScript

// jsfiddle configured to load jQuery Sparkline 2.1
// http://omnipotent.net/jquery.sparkline/
// Example of specifying sliceColors as an HTML attribute
// by turning on enableTagOptions


// Draw a sparkline for the #sparkline element
$('#sparkline').sparkline('html', {
    type: "pie",
    enableTagOptions: true
});