• Ext Gantt Web甘特图时间刻度和自定义


    甘特图提供多种不同的时间刻度的定义,用户也可以自定义自己的时间刻度。系统内置的时间刻度包括以下六种:

    1       hourAndDay 小时和天刻度

    2       dayAndWeek 天和周刻度

    3       weekAndDay 周和天刻度

    4       weekAndMonth 周和月刻度

    5       monthAndYear 月和年刻度

    6       year 年刻度

    以下是自定义时间刻度的代码。

    1.       Sch.PresetManager.registerPreset("test", {   

    2.               timeColumnWidth : 20,   // Time column width, only applicable when locked columns are used   

    3.               displayDateFormat : "Y-m-d",  // Controls how dates will be displayed in tooltips etc   

    4.               shiftIncrement : 1,     // Controls how much time to skip when calling shiftNext and shiftPrevious.   

    5.               shiftUnit : "w",      // Valid values are "MILLI", "SECOND", "MINUTE", "HOUR", "DAY", "WEEK", "MONTH", "QUARTER", "YEAR".   

    6.               defaultSpan : 12,       // By default, if no end date is supplied to a view it will show 12 hours   

    7.               timeResolution : {      // Dates will be snapped to this resolution   

    8.                   unit : "d",    // Valid values are "MILLI", "SECOND", "MINUTE", "HOUR", "DAY", "WEEK", "MONTH", "QUARTER", "YEAR".   

    9.                   increment : 1   

    10.           },   

    11.           headerConfig : {    // This defines your header, you must include a "middle" object, and top/bottom are optional. For each row you can define "unit", "increment", "dateFormat", "renderer", "align", and "scope"   

    12.               middle : {                

    13.                   unit : "w",   

    14.                   dateFormat : "D d M Y"  

    15.               },   

    16.               /*top : {  

    17.                   unit : "Month",  

    18.                   dateFormat : 'D d/m'  

    19.               },*/  

    20.               bottom:{   

    21.                   increment:1,   

    22.                   unit:"d",   

    23.                   renderer:function(a, b, c, d){   

    24.                       return a.getDate();   

    25.                   }   

    26.               }   

    27.           }   

    28.   });  

  • 相关阅读:
    《数据结构与算法之美》03——数组
    设计模式系列三-代理模式
    Docker系列2-image详解
    docker系列2-centos7下安装docker
    docker系列1-简介
    idea设置JDK无效
    java引用传递还是值传递问题解析
    MySQL优化系列4-全文索引
    MySQL优化系列3-存储引擎
    Redis深入解析系列:分布式锁详解
  • 原文地址:https://www.cnblogs.com/zhangwei595806165/p/2675225.html
Copyright © 2020-2023  润新知