0

I'm trying to draw a bar graph with the scale inverted, ie the 0 on top and 100 at the xaxis crossing in the bottom, but even using ylabels.invert it doesn't work. Can anyone help me?

    var bar4 = new RGraph.Bar(canvM,  [[74,80],[74,80],[75,81],[76,82],[77,83],[76,84],[75,83],[79,84],[77,85],[79,86],[79],[80]])
    .Set('labels', ['2º Semestre 2008','1º Semestre 2009','2º Semestre 2009','1º Semestre 2010','2º Semestre 2010','1º Semestre 2011','2º Semestre 2011','1º Semestre 2012','2º Semestre 2012','1º Semestre 2013','2º Semestre 2013','1º Semestre 2014'])
    .Set('strokestyle', 'transparent')
    .Set('hmargin.grouped', 0)
    .Set('hmargin', 10)
            .Set('ylabels.invert', true)
    .Set('scale.round', true)
    .Set('gutter.bottom', 150)
    .Set('gutter.left', 60)
    .Set('gutter.top', 40)
    .Set('gutter.right', 30)
    .Set('text.angle', 90)
    .Set('labels.above', true)
    .Set('labels.above.size', 8)
    .Set('labels.above.decimals', 2)
    .Set('ymax', 100)
    .Set('shadow', false)
    .Set('background.grid.autofit.numhlines', 4)
    .Set('numxticks', 12)
    .Set('background.grid.autofit.numvlines', 12)
    .Set('colors', ['#e98f16', '#8e493e'])
    .Set('variant', '3d')
    .Set('bevel', true)
    .Set('numyticks', 4)
    .Set('ylabels.count', 4)
    .Set('scale.decimals', 2)
    .Set('units.post', '%')
    .Draw();

4

1 回答 1

1

条形图没有反转选项。但是您可以做的是关闭条形图 Y 轴并使用绘图 API Y 轴对象 - 确实如此。

http://www.rgraph.net/docs/drawing-api-yaxis.html

于 2014-06-01T15:29:57.147 回答