我正在尝试使用 jquery 迷你图。这就是我想要做的。
var values = [{value:123}, {value:234}, {value:345}];
// Draw a sparkline for the #sparkline element
$('#sparkline').sparkline(values.value, {
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'
}
},
});
但是对于这种数据格式,迷你图无法绘制。我必须在我的代码中做些什么改变