Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jqPlot DateAxis浏览器_Javascript_Jquery_Jqplot - Fatal编程技术网

Javascript jqPlot DateAxis浏览器

Javascript jqPlot DateAxis浏览器,javascript,jquery,jqplot,Javascript,Jquery,Jqplot,我在XAxis上使用带有DateAxisRender的jqPlot线图,看到我的浏览器挂起。没有撞车,只是挂在那里 我的图表的代码是: var lineChart = $.jqplot('viewsAppsTime', [data.VIEWS], { seriesColors:["#3bafe4","#00a44d"], grid:{ shadow:false, drawBorder:false, drawGridlines:false, backgrou

我在XAxis上使用带有DateAxisRender的jqPlot线图,看到我的浏览器挂起。没有撞车,只是挂在那里

我的图表的代码是:

var lineChart = $.jqplot('viewsAppsTime', [data.VIEWS], {
  seriesColors:["#3bafe4","#00a44d"],
  grid:{
    shadow:false,
    drawBorder:false,
    drawGridlines:false,
    background:"#fff"
  },
  gridPadding:{bottom:20},
  seriesDefaults:{
    markerOptions:{
      style:"circle",
      lineWidth:5,
      size:12
    }
  },
  axesDefaults:{
    min:0,
    showTickMarks:false,
    tickOptions:{
      showLabel:true,
      showMark:false,
      showGridline:false
    }
  },
  highlighter:{
    show:true,
    tooltipAxes:"y"
  },
  title:"Visits and Applications",
  height:"340px",
  axes:{
    xaxis:{
      label:"Days Active",
      renderer: $.jqplot.DateAxisRenderer,
      tickInterval:7,
      tickOptions:{}
    }
  },
  series:[
    {
      label:"Visits",
      neighborThreshold:-1
    },{
      label:"Applications",
      neighborTheshold:-1
    }
  ],
  legend:{
    show:true,
    location:"ne",
    yOffset:0
  }
});
data.VIEWS变量如下所示(实际值的副本):


我已经阅读并复制了答案中链接的文件,但我仍然看到我的浏览器挂起。

我发现问题的原因是我对tickInterval使用了错误的语法,并且我必须指定最小值和最大值。我修改代码如下:

  axes:{
    xaxis:{
      label:"Days Active",
      renderer: $.jqplot.DateAxisRenderer,
      tickInterval:"7 days",
      min: data.VIEWS[0][0],
      max: data.VIEWS[data.VIEWS.length-1][0]
      tickOptions:{}
    }
  },
  axes:{
    xaxis:{
      label:"Days Active",
      renderer: $.jqplot.DateAxisRenderer,
      tickInterval:"7 days",
      min: data.VIEWS[0][0],
      max: data.VIEWS[data.VIEWS.length-1][0]
      tickOptions:{}
    }
  },