我正在尝试在 jquery sparkline 插件中使用堆叠条,我的版本在 2.1.2 中,正常的迷你图工作正常,但是堆叠条类型不起作用,这是我的代码(类似):
<span class="sparklines" data-sparkline-value="1:2,3:4,5:4,3:2"></span>
和初始化函数
$('.sparklines').each(function () {
$(this).sparkline(
$(this).data("sparkline-value"), {
type: $(this).data("sparkline-type") ? $(this).data("sparkline-type") : 'bar',
barWidth: $(this).data("sparkline-bar-width") ? $(this).data("sparkline-bar-width") : 5,
negBarColor: '#f44',
stackedBarColor: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00',
'#dd4477', '#0099c6', '#990099'],
barSpacing: $(this).data("sparkline-bar-spacing") ? $(this).data("sparkline-bar-spacing") : 2,
height: $(this).data("sparkline-height") ? $(this).data("sparkline-height") : '20px',
barColor: $(this).data("sparkline-color") ? $(this).data("sparkline-color") : '#7BB2B4',
enableTagOptions: true
});
});