Jquery 使用jqplot条形图无任何渲染的3个以上数据集时

Jquery 使用jqplot条形图无任何渲染的3个以上数据集时,jquery,jqplot,Jquery,Jqplot,当使用jqplot示例堆叠条形图和三个以上的数据集无任何渲染时,使用三个数据集(如s1、s2和s3)时效果良好。如果我添加了全部9个段或三个以上的段,那么我在页面上看不到任何内容,或者在控制台上没有抛出任何java脚本错误。它无法呈现图形 $(document).ready(function(){ var s1 = [2, 6, 7, 10, 5, 8, 4, 12, 6, 9]; var s2 = [7, 5, 3, 4, 8, 3, 6, 8, 10, 12]; var s3 =

当使用jqplot示例堆叠条形图和三个以上的数据集无任何渲染时,使用三个数据集(如s1、s2和s3)时效果良好。如果我添加了全部9个段或三个以上的段,那么我在页面上看不到任何内容,或者在控制台上没有抛出任何java脚本错误。它无法呈现图形

$(document).ready(function(){
  var s1 = [2, 6, 7, 10, 5, 8, 4, 12, 6, 9];
  var s2 = [7, 5, 3, 4, 8, 3, 6, 8, 10, 12];
  var s3 = [14, 9, 3, 8, 3, 7, 2, 15, 10];
  var s4 = [4, 3, 9, 12, 7, 6, 3, 8, 3, 8];
  var s5 = [7, 5, 3, 4, 8, 3, 6, 8, 10, 12];
  var s6 = [14, 9, 3, 8, 3, 7, 2, 15, 10];
  var s7 = [2, 6, 7, 10, 5, 8, 4, 12, 6, 9];
  var s8 = [7, 5, 3, 4, 8, 3, 6, 8, 10, 12];
  var s9 = [14, 9, 3, 8, 3, 7, 2, 15, 10];
  var ticks = ['Day 1', 'Day 2', 'Day 3', 'Day 4', 'Day 5', 'Day 6', 'Day 7', 'Day 8', 'Day 9', 'Day 10'];
  plot3 = $.jqplot('graph_container', [s1, s2, s3, s4,s5,s6,s7,s8, s9], {
    // Tell the plot to stack the bars.
    stackSeries: true,
    captureRightClick: true,
    seriesDefaults:{
      renderer:$.jqplot.BarRenderer,
      rendererOptions: {
          // Put a 30 pixel margin between bars.
          barMargin: 30,
          // Highlight bars when mouse button pressed.
          // Disables default highlighting on mouse over.
          highlightMouseDown: true   
      },
      pointLabels: {show: true}
    },
    series:[
            {label:'Errors'},
            {label:'Warnings'},
            {label:'Info'},
            {label:'Errors2'},
            {label:'Warnings2'},
            {label:'Info2'},
            {label:'Errors3'},
            {label:'Warnings3'},
            {label:'Info3'}
        ],
    axes: {
      xaxis: {
          renderer: $.jqplot.CategoryAxisRenderer,
          ticks: ticks
      },
      yaxis: {
        // Don't pad out the bottom of the data range.  By default,
        // axes scaled as if data extended 10% above and below the
        // actual range to prevent data points right on grid boundaries.
        // Don't want to do that here.
        padMin: 5
      }
    },
    legend: {
      show: true,
      location: 'e',
      placement: 'outside'
    }      
  });
  // Bind a listener to the "jqplotDataClick" event.  Here, simply change
  // the text of the info3 element to show what series and ponit were
  // clicked along with the data for that point.
  $('#graph_container').bind('jqplotDataClick', 
    function (ev, seriesIndex, pointIndex, data) {
      $('#info_container').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
    }
  ); 
});

您需要为每个输入数组指定相等数量的值,如s1有10个元素,其中s2有9个元素,请更正,然后它将工作