jQuery Sparkline Bar Chart Labels with named offsets
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 = [100.00,100.00,100.00,80.00,80.00,66.67];
// Draw a sparkline for the #sparkline element
$('#sparkline').sparkline(values, {
type: "bar",
height: 50,
width: 500,
// Map the offset in the list of values to a name to use in the tooltip
tooltipFormat: '{{offset:offset}} {{value}}',
tooltipValueLookups: {
'offset': {
0: 'Jul',
1: 'Aug',
2: 'Sep',
3: 'Oct',
4: 'Nov',
5: 'Dev',
}
},
});