带有表和子任务的Higcharts Gantt图表

时间:2019-05-15 15:34:43

标签: highcharts gantt-chart

使用左侧的表格时,如何具有可折叠的子任务?如果我删除表列,那么它可以正常工作。这是官方网站上的示例,很遗憾,我的案例没有演示。任何指导表示赞赏。

这是我玩过的小提琴:https://jsfiddle.net/sharvadze/4h80gdts/1/

Highcharts.ganttChart('container', {

title: {
    text: 'Left Axis as Table'
},

xAxis: {
    tickPixelInterval: 70
},

yAxis: {
    type: 'category',
    grid: {
        enabled: true,
        borderColor: 'rgba(0,0,0,0.3)',
        borderWidth: 1,
        columns: [{
            title: {
                text: 'Project'
            },
            labels: {
                format: '{point.name}'
            }
        }, {
            title: {
                text: 'Assignee'
            },
            labels: {
                format: '{point.assignee}'
            }
        }, {
            title: {
                text: 'Est. days'
            },
            labels: {
                formatter: function () {
                    var point = this.point,
                        days = (1000 * 60 * 60 * 24),
                        number = (point.x2 - point.x) / days;
                    return Math.round(number * 100) / 100;
                }
            }
        }, {
            labels: {
                format: '{point.start:%e. %b}'
            },
            title: {
                text: 'Start date'
            }
        }, {
            title: {
                text: 'End date'
            },
            offset: 30,
            labels: {
                format: '{point.end:%e. %b}'
            }
        }]
    }
},

tooltip: {
    xDateFormat: '%e %b %Y, %H:%M'
},

series: [{
    name: 'Project 1',
    data: [{
            id: 'test',
        start: Date.UTC(2017, 10, 18, 8),
        end: Date.UTC(2017, 10, 25, 16),
        name: 'Start prototype',
        assignee: 'Richards',
        y: 0
    }, {
            parent: 'test',
        start: Date.UTC(2017, 10, 20, 8),
        end: Date.UTC(2017, 10, 24, 16),
        name: 'Develop',
        assignee: 'Michaels',
        y: 1
    }, {
        start: Date.UTC(2017, 10, 25, 16),
        end: Date.UTC(2017, 10, 25, 16),
        name: 'Prototype done',
        assignee: 'Richards',
        y: 2
    }, {
        start: Date.UTC(2017, 10, 27, 8),
        end: Date.UTC(2017, 11, 3, 16),
        name: 'Test prototype',
        assignee: 'Richards',
        y: 3
    }, {
        start: Date.UTC(2017, 10, 23, 8),
        end: Date.UTC(2017, 11, 15, 16),
        name: 'Run acceptance tests',
        assignee: 'Halliburton',
        y: 4
    }]
}]
});

0 个答案:

没有答案