Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/409.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 x轴上的JQPlot日期_Javascript_Jquery_Jqplot - Fatal编程技术网

Javascript x轴上的JQPlot日期

Javascript x轴上的JQPlot日期,javascript,jquery,jqplot,Javascript,Jquery,Jqplot,我正在使用JQPLot进行绘图,但日期的x轴定义不起作用 我使用了下面的选项 axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}}, 但它还是失败了……有什么输入吗 <html> <head> </head> <body> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js

我正在使用JQPLot进行绘图,但日期的x轴定义不起作用

我使用了下面的选项

        axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}},
但它还是失败了……有什么输入吗

<html>
<head>

</head>
<body>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>

<script type="text/javascript" src="c:/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="c:/jquery/dist/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="c:/jquery/dist/plugins/jqplot.bubbleRenderer.min.js"></script>
<link rel="stylesheet" type="text/css" hrf="c:/jquery/dist/jquery.jqplot.min.css" />


<script>

$(document).ready(function(){

    //var arr = [[11, 123, 1236, "Acura"], [45, 92, 1067, "Alfa Romeo"],
    //[24, 104, 1176, "AM General"], [50, 23, 610, "Aston Martin Lagonda"],
    //[18, 17, 539, "Audi"], [7, 89, 864, "BMW"], [2, 13, 1026, "Bugatti"]];

    //var arr = [[100,158.73,1,{"label":"WINNER, INC."}]
        //,[200,58.73,1,{"label":"A, INC."}]
        //,[300,358.73,1,{"label":"B, INC."}]
    //,[400,458.73,1,{"label":"C, INC."}]]

    var arr = [["2013-08-19",158.73,1,{"label":"WINNER, INC."}]
        ,["2011-0-19",58.73,1,{"label":"A, INC."}]
        ,["2012-08-19",,358.73,1,{"label":"B, INC."}]
    ,["2018-08-19",,458.73,1,{"label":"C, INC."}]]






    plot1 = $.jqplot('chartdiv',[arr],{
        title: 'Transparent Bubbles',
        seriesDefaults:{
            renderer: $.jqplot.BubbleRenderer,
            axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}},
            rendererOptions: {
                bubbleAlpha: 0.6,
                highlightAlpha: 0.8
            },
            shadow: true,
            shadowAlpha: 0.05
        },


    });
});


</script>

<div id="chartdiv" style="height:400px;width:300px; "></div>

</body>
</html>

$(文档).ready(函数(){
//var arr=[[1121236,“Acura”],[45921067,“Alfa Romeo”],
//[241041176,“AM General”],[5023610,“Aston Martin Lagonda”],
//[18,17,539,“奥迪”],[7,89,864,“宝马”],[2,13,1026,“布加迪”];
//var arr=[[100158.73,1,{“标签”:“WINNER,INC.”]
//,[200,58.73,1,{“标签”:“A公司”}]
//,[300358.73,1,{“标签”:“B公司”}]
//,[400458.73,1,{“标签”:“C公司”}]
var arr=[“2013-08-19”,158.73,1,{“标签”:“WINNER,INC.”]
,[“2011-0-19”,58.73,1,{“标签”:“A公司”}]
,[“2012-08-19”,358.73,1,{“标签”:“B公司”}]
,[“2018-08-19”,458.73,1,{“标签”:“C公司”}]
plot1=$.jqplot('chartdiv',[arr]{
标题:“透明气泡”,
系列默认值:{
渲染器:$.jqplot.bubblerender,
轴:{xaxis:{渲染器:$.jqplot.DateAxisRenderer},
渲染器选项:{
泡泡阿尔法:0.6,
highlightAlpha:0.8
},
影子:没错,
阴影阿尔法:0.05
},
});
});

html:

<div id="chartdiv" style="height:400px;width:300px; "></div>
$(document).ready(function () {
    var arr = [
        ["2013-08-19 4:00PM", 158.73,1, {
            "label": "WINNER, INC."
        }],
        ["2011-08-19 4:00PM", 58.73,1, {
            "label": "A, INC."
        }],
        ["2012-08-19 4:00PM", 358.73,1, {
            "label": "B, INC."
        }],
        ["2018-08-19 4:00PM", 458.73,1, {
            "label": "C, INC."
        }]
    ]

    plot1 = $.jqplot('chartdiv', [arr], {
        title: 'Transparent Bubbles',
        axes: {
            xaxis: {
                renderer: $.jqplot.DateAxisRenderer
            }
        },
        seriesDefaults: {
            renderer: $.jqplot.BubbleRenderer,
            rendererOptions: {
                bubbleAlpha: 0.6,
                highlightAlpha: 0.8
            },
            shadow: true,
            shadowAlpha: 0.05
        }
    });
});

但它仍然失败了:Define失败了。它是如何失败的?发生了什么?请看:注意,尽管jqPlot将解析大多数人类可读的日期,但尽可能使用javascript时间戳是最安全的。此外,最好指定日期和时间,而不仅仅是日期。这是由于浏览器对本地时间和UTC(无日期)的处理不一致。也许试着用时间戳?或者至少在你的约会中加入一段时间?马特:我在x axesThanks中没有看到任何东西,但相同的代码在我的浏览器中不起作用…我从need@user1050619,此示例使用jqPlot 1.0.8r1250。JSFIDLE不工作还是您的应用程序不工作?我这样问是因为您可能错过了对
jqplot.DateAxisRenderer
的引用。同时删除对jquery的重复引用并重新排序所有引用:
*.css
jquery
jquery.ui
jqplot
jqplot.DateAxisRenderer
jqplot.BubblerRenderer
,是的,fiddle对我不起作用……这是链接…@user1050619,你的提琴不包括任何对jqPlot或其plugins@user1050619,请查看侧边栏中的“外部资源”