Highcharts - 甘特图情节问题

时间:2013-02-22 14:10:28

标签: javascript jquery highcharts timeline gantt-chart

我想绘制甘特图并使用this solution。只要我不开始使用大间隔,它就像一个魅力。

// Define tasks (unixtime * 1000)
var tasks = [{
    name: 'Eat',
    intervals: [{ // From-To pairs
        from: 1360800000000,
        to: 1360886400000
    }, {
        from: 1360368000000,
        to: 1360454400000,
    }, {
        from: 1360195200000,
        to: 1360281600000,
    }, {
        from: 1361059200000,
        to: 1361232000000
    }]
}];

根据上面的代码,这是my example。如果将鼠标悬停在间隔上,您将看不到预期的结果:它显示其他间隔的错误工具提示。

我的代码出了什么问题?可能我应该定义期间格式或类似的东西吗?

提前致谢。

1 个答案:

答案 0 :(得分:1)

时间序列数据必须按时间顺序排列。我重新订购了这样的列表,工具提示符合预期:

var tasks = [{
    name: 'Eat',
    intervals: [{
        from: 1360195200000,
        to: 1360281600000,
    },{
        from: 1360368000000,
        to: 1360454400000,
    },{
        from: 1360800000000,
        to: 1360886400000
    }, {
        from: 1361059200000,
        to: 1361232000000
    }]
}];