Inverted Axis in AXLSX Bar Chart

强颜欢笑 提交于 2021-01-27 14:02:07

问题


I'm using this very straightforward code (practically the same as the bar chart examples here, however I am noticing that the Axes are inverted. The data that should be on the Val axis is shown on the Cat axis.

This is also true for the example linked above, and I can't seem to find a way to put them in the correct order.

Below is an image of the problem. The code used to generate it is:

sheet.add_chart(Axlsx::Bar3DChart,:title => "Chart", :show_legend => false, :start_at => "A1", :end_at => "P30", :bar_dir => :col) do |chart|
   chart.add_series :data => sheet["B1:B25"], :labels => sheet["A1:A25"]
   chart.valAxis.gridlines = false
   chart.catAxis.gridlines = false
end


回答1:


I fixed it. You can find my fork of axlsx here: https://github.com/HansCz/axlsx.

A pull request will be sent to https://github.com/randym/axlsx



来源:https://stackoverflow.com/questions/17201836/inverted-axis-in-axlsx-bar-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!