【问题标题】:How to invert RGraph bar chart y-axis如何反转 RGraph 条形图 y 轴
【发布时间】:2014-05-25 20:38:29
【问题描述】:

我正在尝试绘制一个比例倒置的条形图,即顶部的 0 和底部的 xaxis 交叉点的 100,但即使使用 ylabels.invert 它也不起作用。 谁能帮帮我?

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

【问题讨论】:

    标签: javascript scale axis rgraph


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2018-10-18
      • 1970-01-01
      • 1970-01-01
      • 2018-02-08
      • 2021-03-06
      • 2014-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多