jquery中的plot函数的使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jal517486222/article/details/82779645

调用plot函数的方法如下:

var plot = $.plot(placeholder, data, options)

$.plot($("#submission"), [
            {label: "<?php echo $MSG_SUBMIT?>", data: d1, points: {show: true},lines:{show:true},color:"#00FFFF"},
            {label: "<?php echo $MSG_AC?>", data: d2, lines: {show: true}, color:"#00FF00"},
            {label: "<?php echo $MSG_LANGUAGE_C?>", data: language_d0, lines: {show: true},color:"#FFFF00"},
            {label: "<?php echo $MSG_LANGUAGE_CPP?>", data: language_d1, lines: {show: true},color:"#FF7D00"},
            {label: "<?php echo $MSG_LANGUAGE_JAVA?>", data: language_d6, lines: {show: true},color:"#FF0000"},
            {label: "<?php echo $MSG_LANGUAGE_PYTHON?>", data: language_d3, lines: {show: true},color:"#0000FF"}
        ], {
            grid: {
                backgroundColor: {colors: ["#fff", "#d2d2ff"]}
            },
            xaxis: {
                mode: "time"//,
//max:(new Date()).getTime(),
//min:(new Date()).getTime()-100*24*3600*1000
            },
            legend:
                {
                    position:
                        "nw" //这里设置label在表格中的位置。”nw“,"ne", "sw" ,"se" 分别表示左上,右上,左下,右下
                }
        });
    });

猜你喜欢

转载自blog.csdn.net/jal517486222/article/details/82779645