x轴时间轴visjs上的自定义日期

时间:2017-11-10 01:42:38

标签: vis.js vis.js-timeline

如何制作具有特定日期数组的自己的x轴以及每个x轴的特定标签?

像这样......

enter image description here

enter image description here

这是每三个星期,但我的必要性是每个蓝色组(有色是事件)的标记,每个组都有开始和结束日期

1 个答案:

答案 0 :(得分:1)

您可以使用格式功能来自定义x轴标签。例如,

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