gpt4 book ai didi

time - Flot 未正确显示 x Axis 标签

转载 作者:行者123 更新时间:2023-12-01 07:16:28 25 4
gpt4 key购买 nike

我必须在 X Axis 上显示日期和 Y Axis 上的 Amt 图表。将有 8 行(系列),每行有 n 个月的数据。
当我绘制图表时,我肯定会发送 6 个月的数据。(下面显示一行数据)

[1251701950000, 34.50553]
[1254294030000, 27.014463]
[1256972350000, 26.7805]
[1259567970000, 33.08871]
[1262246430000, 51.987762]
[1264924750000, 56.868233]

然而,图表显示如下 http://twitpic.com/1gbb7m

第一个月标签丢失,上个月没有正确对齐,我的flot js代码如下

$.plot($("#lgdGraphTab"),graphData, { 
xaxis: {
mode: "time",
timeformat: "%b-%y",
monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
minTickSize: [1, "month"]
},
yaxis : {
tickSize: 5
},
series: {
lines: { show: true , shadowSize:0},
points: { show: true }
},
legend:{
container: $('#legendArea'),
noColumns:8
},
clickable: true,
hoverable: true
});

最佳答案

数据中的所有时间戳都保存在每个月的最后一天,而不是第一天。我相信这是你的问题的原因。

关于time - Flot 未正确显示 x Axis 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2659300/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com