flot如何避免x轴重复日期值

时间:2015-02-23 03:07:40

标签: flot

我有一个flot折线图,其中x值正在重复,但我无法弄清楚原因。我该如何解决这个问题?

我的x轴被定义为......

  chartOptions = {
    xaxis: {
      mode: "time",
      timeformat: "%d/%m/%y",
      //tickSize: [1, "day"],
      //tickLength: 2
    },

我的数据是......

[1424005200000,20795],[1424091600000,20151],[1424178000000,22448],[1424264400000,27000],[1424350800000,30622],[1424437200000,30844],[1424523600000,23139]

enter image description here

1 个答案:

答案 0 :(得分:0)

使用:minTickSize: [1,"day"] 所以这一天将在图表中出现一次。

 chartOptions = {
        xaxis: {
          mode: "time",
          timeformat: "%d/%m/%y",
          minTickSize: [1,"day"],
          //tickLength: 2
        },