Javascript x轴时间戳图js
我试图创建一个图形,其中x轴由时间戳(日期)和Y轴数据组成。 我的X轴有问题, 我可以编辑哪些代码,使其具有类似“日期(Y-m-d)”的模板 我需要帮助,我搜索了很多,但什么也没找到Javascript x轴时间戳图js,javascript,php,timestamp,Javascript,Php,Timestamp,我试图创建一个图形,其中x轴由时间戳(日期)和Y轴数据组成。 我的X轴有问题, 我可以编辑哪些代码,使其具有类似“日期(Y-m-d)”的模板 我需要帮助,我搜索了很多,但什么也没找到 $a=[1419717600000,0],[1419631200000,1000],[1419544800000,1000],[1419458400000,6000],[1419372000000,2000],[1419285600000,0],[1419199200000,0],[1419112800000,0]
$a=[1419717600000,0],[1419631200000,1000],[1419544800000,1000],[1419458400000,6000],[1419372000000,2000],[1419285600000,0],[1419199200000,0],[1419112800000,0],[1419026400000,0],[1418940000000,0],[1418853600000,0];
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$(function () {
var plot = $.plot($("#placeholder"),[
{ data: [$a], color: 'black'}
], {
series: {
lines: { show: true, fill: true, fillColor: 'rgba(143, 198, 242, 0)' },
points: { show: true}
},
grid: {
color: 'transparent',
margin: 10
},xaxis: {
mode: "time",
timeformat: "%Y/%m/%d"
},
xaxis: {
color: 'white',
font: { color: 'white', family: 'sans-serif', size: 11}
},
yaxis: {
color: 'white',
font: { color: 'white', family: 'sans-serif', size: 11}
}
});
});
});//]]>
</script>
$a=[1419717600000,0]、[14196312000001000]、[1419544800001000]、[14194584000006000]、[14193720000002000]、[1419285600000,0]、[14191992000000,0]、[1419112800000,0]、[1419026400000,0]、[1418940000000,0]、[1418853600000,0];
//
尝试将时间戳值乘以1000,如回答所示。(代表人数太少,无法发表评论)