Custom dates on x-axis timeline visjs

Viewed 1636

How can I make my own x-axis with a specific dates array and particular label for each one?

Something like this...

enter image description here

enter image description here

These are every three weeks, but my necesity is a mark every blue group (colored are events), each group has a start and end dates

1 Answers

You can customize the x-axis labels using a format function. E.g.,

  options: {
    showMinorLabels: false,
    timeAxis: { scale: 'day', step: 1 },
    format: {
      majorLabels: function (date, scale, step) {
        // return a custom label or "" depending on the date
      }
    }
  }
Related