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();

General Grievance
  • 4,555
  • 31
  • 31
  • 45
RBrazao
  • 49
  • 1
  • 6

1 Answers1

1

The Bar chart doesn't have an invert option. But what you can do is turn the Bar chart Y axis off and use the drawing API Y axis object - which does.

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

Richard
  • 4,809
  • 3
  • 27
  • 46