Domanda

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.

È stato utile?

Soluzione

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
    }]
}];
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top