jQuery Sparkline Pie Chart Labels
HTML
<script src="http://omnipotent.net/jquery.sparkline/2.1/jquery.sparkline.js"></script>
<p>
Sparkline appears here: <span id="sparkline"> </span>
</p>
JavaScript
// jsfiddle configured to load jQuery Sparkline 2.1
// http://omnipotent.net/jquery.sparkline/
// Values to render
var values = [1, 2, 3,4];
// Draw a sparkline for the #sparkline element
$('#sparkline').sparkline(values, {
chart:{
width:100,
height:70
},
type: "pie",
// Map the offset in the list of values to a name to use in the tooltip
tooltipFormat: '{{offset:offset}} ({{percent.1}}%)',
tooltipValueLookups: {
'offset': {
0: 'First',
1: 'Second',
2: 'Third'
}
},
});