如何使用流程图创建分组和堆栈(两者)? [英] How to create Grouped and Stack (both) using flow chart?

查看:561
本文介绍了如何使用流程图创建分组和堆栈(两者)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以绘制分组或堆栈流程图,但不能结合他们
像这样:



您可以帮我,谢谢

解决方案

您需要添加订单栏堆叠插件(以此顺序)。



然后您需要添加 stack bars.order 属性,以允许排序和堆叠,如下所示:

  var series = [{
data:[[0,35],[1,70],[2,33]],
stack:1,
bars:{
order:1
}
},{
data:[[0,35],[1,20] [2,33]],
stack:1,
bars:{
order:1
}
},{
data:[[0 ,30],[1,10],[2,34]],
stack:2,
bars:{
order:2
}
} {
data:[[0,35],[1,70],[2,33]],
stack:2,
bars:{
order:2
}
}};

上面的选项将第一个两个系列对象堆叠在一起,前两个堆叠系列在第二个堆叠系列之前订购。有关堆叠栏的示例,请访问此JSFiddle示例



使用自定义值替换xaxis值可以通过设置 xaxis.ticks 属性来完成:

  var options = {
系列:{
bars:{
show:true,
barWidth:.2
}
},
xaxis:{
tickSize:1,
ticks:[
[0,A],
[1,B ],
[2,C]
]
}
};


I can draw Grouped or stack flow chart but cant combine them like this:

Can you help me, thank you

解决方案

To group stacked bars, you need to include the orderBars and stacked plugins (in that order).

You then need to add a stack and bars.order property to each of your series to allow the ordering and stacking, like so:

var series = [{
    data: [[0, 35], [1, 70], [2, 33]],
    stack: 1,
    bars: {
        order: 1
    }
}, {
    data: [[0, 35], [1, 20], [2, 33]],
    stack: 1,
    bars: {
        order: 1
    }
}, {
    data: [[0, 30], [1, 10], [2, 34]],
    stack: 2,
    bars: {
        order: 2
    }
}, {
    data: [[0, 35], [1, 70], [2, 33]],
    stack: 2,
    bars: {
        order: 2
    }
}];

The options above will stack the first two series object together and the second two series objects together, with the first two stacked series ordered before the second two stacked series. An example of stacking bars can be found at this JSFiddle example.

Replacing the xaxis values with custom values can be done by setting the xaxis.ticks property:

var options = {
    series: {
        bars: {
            show: true,
            barWidth: .2
        }
    },
    xaxis: {
        tickSize: 1,
        ticks: [
            [0, "A"],
            [1, "B"],
            [2, "C"]
        ]
    }
};

这篇关于如何使用流程图创建分组和堆栈(两者)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆