我正在使用flot库来显示条形图,我需要以这种方式按特定值分组:
|
| +----+ +----+
| | | | |
| | | | |
| | | | |
| +----+ | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|-+----+---+----+--------+----+----
val 1 val2 val3
category #1 category #2
感谢Sergey G.为Ascii:)
我将变量d1,d2,d3分别设置为条形1,2和3的值(按类别排序)。 问题是: 如何添加以下滴答类别? 对不起我的“谷歌翻译”英文,非常感谢你!
代码:
$.plot(
$("#placeholder"),
[
{
label: labelChart,
data: d1,
color: '#92d5ea',
bars: {
show: true,
barWidth: 0.5,
align: "center",
order:2
},
multiplebars:true
},
{
label: labelChart,
data: d2,
color: '#92d5ea',
bars: {
show: true,
barWidth: 0.5,
align: "center",
order:3
},
multiplebars:true
},
{
label: labelChart,
data: d3,
color: '#92d5ea',
bars: {
show: true,
barWidth: 0.5,
align: "center",
order:3
},
multiplebars:true
}
],
{
xaxis: {
ticks: ticksData
},
yaxis: {
min:0
}
}
);