Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.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:线图:不显示线和记号_Javascript_Jqplot_Linegraph - Fatal编程技术网

Javascript jqPlot:线图:不显示线和记号

Javascript jqPlot:线图:不显示线和记号,javascript,jqplot,linegraph,Javascript,Jqplot,Linegraph,我正在努力创建一个jqPlot线条图,希望有人能帮助我。由于某种原因,我的线条和记号没有出现,我也不知道为什么。我复制了下面的麻烦代码 谁能告诉我我做错了什么 如果有什么我可以做的,以帮助说明或解决问题,请让我知道 $(document).ready(function(){ var line1 = [['07-01-2014',0],['08-01-2014',87],['09-01-2014',0],['10-01-2014',0],['11-01-2014',0],['12-

我正在努力创建一个jqPlot线条图,希望有人能帮助我。由于某种原因,我的线条和记号没有出现,我也不知道为什么。我复制了下面的麻烦代码

谁能告诉我我做错了什么

如果有什么我可以做的,以帮助说明或解决问题,请让我知道

$(document).ready(function(){   

    var line1 = [['07-01-2014',0],['08-01-2014',87],['09-01-2014',0],['10-01-2014',0],['11-01-2014',0],['12-01-2014',0],['01-01-2015',0],['02-01-2015',71],['03-01-2015',0],['04-01-2015',83],['05-01-2015',0],['06-01-2015',82]]
    var line2 = [['07-01-2014',0],['08-01-2014',85],['09-01-2014',0],['10-01-2014',0],['11-01-2014',1],['12-01-2014',0],['01-01-2015',0],['02-01-2015',71],['03-01-2015',0],['04-01-2015',83],['05-01-2015',0],['06-01-2015',82]]
    var jqpData = [line1, line2];

    var xLabels = ['07-01-2014','08-01-2014','09-01-2014','10-01-2014','11-01-2014','12-01-2014','01-01-2015','02-01-2015','03-01-2015','04-01-2015','05-01-2015','06-01-2015'],
        lLables = ['Series 1','Series 2'];

    $(function () {
        var plot1 = $.jqplot('chart1', jqpData, {
            title: 'July through June',
            seriesDefaults:{

                rendererOptions: {smooth: true},
                label:' ',
                lineWidth: 2
            },
            axesDefaults: {
                labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
                tickRenderer: $.jqplot.CanvasAxisTickRenderer
            },
            legend:{
                show: true,
                location: 'sw',
                placement: 'outsideGrid',
                labels: lLables
            },
            axes: {
                xaxis: {
                    renderer:$.jqplot.DateAxisRenderer,
                    tickOptions:{
                        angle:-30,
                        fontFamily:'Trebuchet MS,Arial,Helvetica,sans-serif',
                        fontSize: '1em',
                        min:'07-01-2014', 
                        tickInterval:'1 month'
                    }
                },
                yaxis:{
                    label:'',
                    min:0,
                    max:96.9849
                }
            }
        });
    });
});

尝试将此添加为选项之一:

axes: {
    xaxis:{
        renderer: $.jqplot.CategoryAxisRenderer, //etc
更多信息请点击此处: 如果您还没有:

http://www.jqplot.com/docs/files/jqplot-axisTickRenderer-js.html
然后按如下所示进行应用:

http://www.jqplot.com/tests/rotated-tick-labels.php

您是否已将所有必需的插件作为
DateAxisRenderer
?控制台中是否出现任何错误?请在没有选项的情况下尝试,只添加行,然后逐个添加。如果需要显示记号,则需要将其转义,告诉JavaScript它们是文字。像这样的逃避角色:“
你好,我的名字叫\@Godisgood!
”正是我所需要的!天才,太棒了!我很高兴能帮上忙