Flip Bar Chart vertically

Hi,

I’m trying to create a vision window using a bar chart showing positive values from top moving downwards. I also want the axis label to be on the top, almost like flipping/mirror the chart vertically.

Does anyone now how to do something like this?

Hilsen Stian

I think you can use a Vision chart set as category type, and rendered as a bar chart. You can use the chart customizer to move your axis and labels around. For the life of me i could not get the chart to work in category mode, i am sure i just missed something obvious though.

Edit:
This forced me learn more about how charts work, and now i have a better answer! Yes you can, you just need to set the jfree axis to inverted and to change the domain axis location. I put this on a mouse click event just as a test.

from org.jfree.chart.axis import AxisLocation
event.source.getChart().getPlot().getRangeAxis().setInverted(True)
event.source.getChart().getPlot().setDomainAxisLocation(AxisLocation.TOP_OR_LEFT)

V6r6zYLu7X

1 Like

Thanks!

That was exactly what i was trying to achieve

1 Like