Chartjs-Chart.js multi line chart that has different labels

0👍

So you have to create label first, which should be all time as explained below for A and B combined.
Now For A {‘time’:’2020-11-20 00:00:00′, "value":21},
{‘time’:’2020-11-20 00:01:00′, "value":22},
then check this principle.
For A 2020-11-20 00:00:30 value must be 21 only as nothing has been changed so assuming that you can create same number of labels for line and place values.

var myLineChart = new Chart(ctx).Line(data);
  var data = {
      labels: ["2020-11-20 00:00:00", "2020-11-20 00:30:00", "2020-11-20 01:00:00", "2020-11-20 01:30:00", "2020-11-20 02:00:00", "2020-11-20 02:30:00", "2020-11-20 03:00:00"],
      datasets: [
          {fillColor: "rgba(220,220,220,0.2)",
           strokeColor: "rgba(220,220,220,1)",
           data: [21, 21, 22, 81, 56, 55, 40]
          },
          {fillColor: "rgba(151,187,205,0.2)",
           strokeColor: "rgba(151,187,205,1)",
           data: [22, 23, 40, 19, 86, 27, 90]
          }
      ]};

Leave a comment