jquery 带有对象数组的迷你图
jquery sparkline with array of objects
我正在尝试使用 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'
}
},
});
但是对于这种数据格式,迷你图无法绘制。
我必须对我的代码进行哪些更改
我正在尝试使用 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'
}
},
});
但是对于这种数据格式,迷你图无法绘制。 我必须对我的代码进行哪些更改