Jquery插件Sparkline 怎么组合图啊!为什么我使用composite: true无法组合起来。给个实例更好!急急急
下面是我的代码:但是就是无法组合,只显示第一个图
<div class="col-md-8" style="float:right"> <div class="sparkline-chart"> @for (int i = 0; i < Model.StrList.Count(); i++) { <input type="hidden" name="sparkline_@Model.QuestionId" questionid="@Model.QuestionId" value="@Model.StrList[i]" /> } <div><span class="number" name="sparkline" questionid="@Model.QuestionId" id="schedule_bar"></span><div></div> <span></span> </div> </div> </div> <script type="text/javascript"> $(document).ready(function () { debugger; var colorarr = new Array('red', 'yellow', 'green', 'blue', 'Purple', 'Orange') $("span[name='sparkline']").each(function (m, data) { debugger; var questionid = $(data).attr("questionid"); $("input[questionid='" + questionid + "']").each(function (n, da) { debugger; var arrstr = $(da).val().split(','); var arr = new Array(); for (var i = 0; i < arrstr.length; i++) { arr[i] = parseInt(arrstr[i]); } if (n == 0) { $(data).sparkline(arr, { type: 'line', width: '200', height: '100', lineColor: colorarr[n], fillColor: false, changeRangeMin: 0, chartRangeMax: 999 }); } else { $(data).sparkline(arr, { composite: true, type: 'line', width: '200', height: '100', lineColor: colorarr[n], fillColor: false, changeRangeMin: 0, chartRangeMax: 999 }); } }) }) }) </script>