我正在尝试着色条形图,但除了按键好了之外,所有条形都显示相同的颜色
window.onload = function ()
{
var bar = new RGraph.Bar('canv1', [20,17,13,7,5,1,1,1,1,1,1,1,1,1,1])
.Set('labels', ['M1','M2','M3','M4','M5','M6','M7','M8','M9','M10','M11','M12','M13','M14','M15'])
.Set('grouping', 'stacked')
.Set('gutter.bottom', 250)
.Set('gutter.left', 100)
.Set('gutter.top', 20)
.Set('gutter.right', 100)
.Set('text.angle', 70)
.Set('labels.above', true)
.Set('labels.above.size', 8)
.Set('ymax', 20)
.Set('shadow', false)
.Set('background.grid.autofit.numhlines', 2)
.Set('numxticks', 15)
.Set('background.grid.autofit.numvlines', 15)
.Set('numyticks', 2)
.Set('ylabels.count', 2)
.Set('key', ['M1','M2','M3','M4','M5','M6','M7','M8','M9','M10','M11','M12','M13','M14','M15'])
.Set('colors', ['#0099FF','#006699','#006699','#006699','#006699','#6699FF','#6699FF','#6699FF','#6699FF','#006699','#006699','#006699','#006699','#006699','#006699'])
.Set('scale.decimals', 0)
.Draw();
}
有人可以帮助我吗?
答案 0 :(得分:0)
尝试添加:
bar.Set('colors.sequential', true);