Change Y axis location in a Bar Chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).

Change Y axis location in a Bar Chart

Postby 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_CJG1yv6jGv-4SBS6HXv7w-VhcCEOT/view?usp=sharing

and this is what i'm getting:
https://drive.google.com/file/d/10ePx5rQOWf9a1OLOlKDt1MozQHVj-PqH/view?usp=sharing

Any ideia how to solve it?
tiago_pina
 
Posts: 2
Joined: Mon Nov 13, 2017 3:05 pm

Re: Change Y axis location in a Bar Chart

Postby 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
david.gilbert
JFreeChart Project Leader
 
Posts: 11653
Joined: Fri Mar 14, 2003 10:29 am

Re: Change Y axis location in a Bar Chart

Postby 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
tiago_pina
 
Posts: 2
Joined: Mon Nov 13, 2017 3:05 pm

Re: Change Y axis location in a Bar Chart

Postby 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
david.gilbert
JFreeChart Project Leader
 
Posts: 11653
Joined: Fri Mar 14, 2003 10:29 am


Return to JFreeChart

Who is online

Users browsing this forum: Google [Bot] and 6 guests