worktile / ngx-gantt

A modern and powerful gantt chart component for Angular
http://gantt.ngnice.com
MIT License
259 stars 73 forks source link

特定数据渲染后,x滚动条使用键盘向左键可以一直滚动 #228

Open 2863416607 opened 2 years ago

2863416607 commented 2 years ago

//这是我的数据
items: GanttItem[] = [ { "id": "v9", "title": "版本注册", "start": 1650601094000, "end": 1650604333000, "group_id": null, "links": null, "draggable": null, "linkable": null, "expandable": null, "expanded": null, "children": null, "color": null, "progress": 1.0, }, { "id": "mergeStep9", "title": "MR合入阶段", "start": 1650601094000, "end": 1651160076000, "group_id": null, "links": null, "draggable": null, "linkable": null, "expandable": null, "expanded": true, "children": [{ "id": "8479356", "title": "41070057", "start": 1650601094000, "end": 1650630051000, "group_id": null, "links": null, "draggable": null, "linkable": null, "expandable": null, "expanded": null, "children": null, "color": null, "progress": 1.0, }, { "id": "8356283", "title": "39220666", "start": 1650619929000, "end": 1650883077000, "group_id": null, "links": null, "draggable": null, "linkable": null, "expandable": null, "expanded": null, "children": null, "color": null, "progress": 1.0 }, { "id": "8428575", "title": "40687355", "start": 1650620349000, "end": 1650781512000, "group_id": null, "links": null, "draggable": null, "linkable": null, "expandable": null, "expanded": null, "children": null, "color": null, "progress": 1.0 }, { "id": "8263517", "title": "40477607", "start": 1650781593000, "end": 1650800577000, "group_id": null, "links": null, "draggable": null, "linkable": null, "expandable": null, "expanded": null, "children": null, "color": null, "progress": 1.0, }, { "id": "8562329", "title": "41225491", "start": 1651144627000, "end": 1651160076000, "group_id": null, "links": null, "draggable": null, "linkable": null, "expandable": null, "expanded": null, "children": null, "color": null, "progress": 1.0, }, { "id": "8499547", "title": "40687355", "start": 1650781631000, "end": 1650795015000, "group_id": null, "links": null, "draggable": null, "linkable": null, "expandable": null, "expanded": null, "children": null, "color": null, "progress": 1.0,

        }, {
            "id": "8506846",
            "title": "40477607",
            "start": 1650800722000,
            "end": 1650866516000,
            "group_id": null,
            "links": null,
            "draggable": null,
            "linkable": null,
            "expandable": null,
            "expanded": null,
            "children": null,
            "color": null,
            "progress": 1.0
        }],
        "color": null,
        "progress": 1.0
    }, {
        "id": "v3.1.5.2testStep",
        "title": "测试阶段",
        "start": 1650884416000,
        "end": 1652112861000,
        "group_id": null,
        "links": null,
        "draggable": null,
        "linkable": null,
        "expandable": null,
        "expanded": true,
        "children": [{
            "id": "20220425184935",
            "title": "20220425184935",
            "start": 1650884416000,
            "end": 1651130303000,
            "group_id": null,
            "links": null,
            "draggable": null,
            "linkable": null,
            "expandable": null,
            "expanded": null,
            "children": null,
            "color": null,
            "progress": 1.0
        }, {
            "id": "20220428234532",
            "title": "20220428234532",
            "start": 1651202216000,
            "end": 1652112861000,
            "group_id": null,
            "links": null,
            "draggable": null,
            "linkable": null,
            "expandable": null,
            "expanded": null,
            "children": null,
            "color": null,
            "progress": 1.0
        }],
        "color": null,
        "progress": 1.0,
    }
];
2863416607 commented 2 years ago

Dingtalk_20220517174529 然后返回看,数据就出问题了

walkerkay commented 2 years ago

我没有理解 x滚动条使用键盘向左键可以一直滚动 这个问题,正常Gantt会有一个默认的最大最小时间的显示范围(不同的视图不同)并且可以自定义,不会无止境的可以滚动 数据显示的问题是因为你传入的时间戳是13位时间戳,而ngx-gantt目前只支持10位的时间戳,这块我会在文档中加以补充说明

2863416607 commented 2 years ago

@walkerkay 你可以用我的数据渲染到你们官方的例子中试试