Highcharts - Gantt Chart plot issue

血红的双手。 提交于 2019-12-06 11:39:41

问题


I want to draw gantt-like chart and using this solution. It works like a charm as long as I don't start to use big intervals.

// 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
    }]
}];

Here is my example, based on code above. If you hover your mouse over the interval you will see not quite what expected: it shows wrong tooltip from other interval.

What's wrong with my code? May be I should define period format or something like that?

Thanks in advance.


回答1:


Time series data must be in chronological order. I re-ordered your list like this and tooltip is as expected:

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


来源:https://stackoverflow.com/questions/15026060/highcharts-gantt-chart-plot-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!