如何使用流程图创建分组和堆栈(两者)? [英] How to create Grouped and Stack (both) using flow chart?
问题描述
我可以绘制分组或堆栈流程图,但不能结合他们
像这样:
您可以帮我,谢谢
然后您需要添加 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屋!