0

it's the first time i am using billboard.js so i'm having difficulties working with timeseries data, here's my try:

exemple of the data:

{
  "values":{
    [5,8],[2020-02-07T07:06:01.591Z,2020-02-07T07:06:03.812Z]
  }
}

how i'm trying to display it (not sure if MS exists):

chart = bb.generate({
  bindto: "#chart",
  data: {
      x: "x",
      xFormat: "%Y-%m-%dT%H:%M:%S.%MSZ",
      type: "line",
      columns: [
          ["x",data.values[1]],
          ["nbr evenements",data.values[0]]
      ]
  },
  axis:{
    x:{
      type:"timeseries",
      localtime:false,
      tick: {
        format: "%Y-%m-%d %H:%M:%S.%MS"
      }
    }
  }
});
Amine Maalfi
  • 145
  • 9

1 Answers1

0

i tried this instead, it worked fine:

chart = bb.generate({
  bindto: "#chart",
  data: {
      x: "x",
      xFormat: "%Y-%m-%dT%H:%M:%S.%LZ",
      type: "line",
      columns: [
          ["x"].concat(data.values[1]),
          ["nbr evenements"].concat(data.values[0])
      ]
  },
  axis:{
    x:{
      type:"timeseries",
      localtime:false,
      tick: {
        format: "%Y-%m-%dT%H:%M:%S"
      }
    }
  }
});
Amine Maalfi
  • 145
  • 9