首页 > 解决方案 > 如何根据 AnyGantt 中的自定义字段调整里程碑标记类型?

问题描述

如何根据 AnyGantt 中的自定义字段调整里程碑标记类型?

我尝试使用它(其中 subType 是字段名称),但它呈现一个星形。

timeline.milestones().markerType(
      function() {
        var customfieldSubType = this.getData('subType'); 
        if (customfieldSubType == "Strategy") {
          return "diamond";
        } else {
          return "circle";
        }
      }
);

标签: gantt-chartanychart

解决方案


markerType ()函数不支持回调。您可以通过在数据中应用单独的里程碑设置来实现所需的外观。详情请查看我准备的样本,并注意里程碑的数据。文档文章中描述了这种方法。


推荐阅读