如何从左到右构建HighCharts条形图?

时间:2012-07-16 15:19:52

标签: javascript jquery highcharts

请参阅此jsFiddle示例,数据系列

series: [{
    name: 'John',
    data: [5, 3, 4, 7, 2]  // the right most part
}, {
    name: 'Jane',
    data: [2, 2, 3, 2, 1]  // the middle part
}, {
    name: 'Joe',
    data: [3, 4, 4, 2, 5]  // the left most part
}]

从右到左创建图表,我正在寻找一种方法,以便图表可以从左到右完成。谢谢!

我的数据:

[
    {
        "day": "2009-07-13",
        "work": ["11:16:35-12:03:12", "12:32:48-13:26:28", "13:39:09-13:39:12", "13:41:03-13:41:05", "14:18:09-24:00:00"]
    }, {
        "day": "2009-07-14",
        "work": ["00:00:00-07:22:25", "07:22:25-07:22:28", "10:10:04-10:10:31", "10:10:32-10:15:33", "10:18:07-10:21:19", "11:04:49-11:06:15", "11:12:50-11:19:05", "11:19:11-11:19:19", "11:45:50-11:51:42", "11:51:43-11:53:55", "14:03:13-14:13:04", "14:23:55-14:31:28", "14:31:28-14:38:00", "14:38:00-14:49:04", "16:34:56-16:44:33", "16:46:37-16:48:10", "16:48:11-24:00:00"]
    }, {
        "day": "2009-07-15",
        "work": ["00:00:00-08:16:23", "09:57:57-10:15:05"]
    }
]

编辑:对我的英语和混淆感到抱歉,another jsFiddle example可以更好地解释我在说什么。我想创建一个图表来表示我的引擎开关打开/关闭状态,以便条形图的数据输入是从左到右,而不是在给小提琴中从右到左。谢谢!

1 个答案:

答案 0 :(得分:1)

大假设,但我认为您正在寻找Gantt图表。 有关提示,请参阅HighCharts论坛上的this帖子。