Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用特定日期数组和每个特定标签制作自己的 x 轴?
像这样的东西...
这些是每三周一次,但我需要标记每个蓝色组(彩色是事件),每个组都有开始和结束日期
您可以使用格式函数自定义 x 轴标签。例如,
options: { showMinorLabels: false, timeAxis: { scale: 'day', step: 1 }, format: { majorLabels: function (date, scale, step) { // return a custom label or "" depending on the date } } }