【问题标题】:Is it possible to display specific hours per day in AMChart4 DateAxis是否可以在 AMChart4 DateAxis 中显示每天的特定小时数
【发布时间】:2021-12-13 10:44:48
【问题描述】:

我正在显示一个基于 AMCharts4 甘特图示例的甘特图,它几乎可以满足我的需求。但我需要日期轴始终显示一天中的特定时间。 例如每天早上 8 点到下午 5 点。 (或 8 到 17)。即使没有数据,或者即使有更多数据。

我已经尝试过间隔设置 (https://www.amcharts.com/docs/v4/concepts/axes/date-axis/),但我并没有完全得到我想要的结果。

【问题讨论】:

    标签: amcharts4


    【解决方案1】:

    好吧,我终于成功了。我现在正在使用轴中断。

    var axisBreak = dateAxis.axisBreaks.create();
    axisBreak.startDate = new Date( day + " 00:00" );
    axisBreak.endDate = new Date( day + " 07:30" );
    
    axisBreak = dateAxis.axisBreaks.create();
    axisBreak.startDate = new Date( day + " 17:30" );
    axisBreak.endDate = new Date( day + " 23:59:59.999" );
    

    适用于我想要实现的目标;)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-29
      • 1970-01-01
      • 2015-08-26
      • 1970-01-01
      • 2010-12-14
      • 1970-01-01
      • 2015-02-16
      • 1970-01-01
      相关资源
      最近更新 更多