Change Y axis location in a Bar Chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
tiago_pina
Posts: 2
Joined: Mon Nov 13, 2017 3:05 pm
antibot: No, of course not.

Change Y axis location in a Bar Chart

Post by tiago_pina » Mon Nov 13, 2017 3:12 pm

So i have a horizontal Bar chart on jaspersoft studio 6.2.0 and i want to fix the Y axis on zero value of X axis(chart has negative values), but no matter what i do it stick always to left side of chart.

This is how i want it to be:
https://drive.google.com/file/d/1nc_CJG ... sp=sharing

and this is what i'm getting:
https://drive.google.com/file/d/10ePx5r ... sp=sharing

Any ideia how to solve it?

david.gilbert
JFreeChart Project Leader
Posts: 11677
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Change Y axis location in a Bar Chart

Post by david.gilbert » Mon Nov 13, 2017 8:49 pm

This is just the way JFreeChart works, it isn't something you can change via the API (even modifying the source code, it wouldn't be a straightforward thing to achieve).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited

tiago_pina
Posts: 2
Joined: Mon Nov 13, 2017 3:05 pm
antibot: No, of course not.

Re: Change Y axis location in a Bar Chart

Post by tiago_pina » Mon Nov 13, 2017 8:57 pm

Thanks for the reply david.gilbert.

But can't i reproduce a line similar to the axis? i was trying to do it but don't know how to put the labels on the new line.

It's getting a bit frustrating because client want the chart like that and more than a week of searching and no results :s

david.gilbert
JFreeChart Project Leader
Posts: 11677
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Change Y axis location in a Bar Chart

Post by david.gilbert » Mon Nov 13, 2017 9:23 pm

It's the labels that are problematic - the code is all written under the assumption that the labels are on the left or right side, never in the middle of the chart. Your client will have to have their "expectations managed" :)
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited

Post Reply