如果您仍在寻找解决方案。
这对我有用 https://groups.google.com/forum/#!topic/jquery-sparkline/XcigtHeVx3M
$('#StackedBarChart').sparkline([
[1, 4, 2],
[2, 3, 2],
[3, 2, 2],
[4, 1, 2]
], {
type: 'bar',
// Map the offset in the list of values to a name to use in the tooltip
myPrefixes: ['USA', 'France','India'],
tooltipFormatter: function(sp, options, fields) {
var format = $.spformat('<div class="jqsfield"><span style="color: {{color}}">●</span> {{myprefix}} {{value}}</div>');
var result = '';
$.each(fields, function(i, field) {
field.myprefix = options.get('myPrefixes')[i];
result += format.render(field, options.get('tooltipValueLookups'), options);
})
return result;
},
height: "75px",
barWidth: "30px",
});
参见示例
http://jsfiddle.net/Hj6fB/241/