Can I begin JFree Area Chart from Y-axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
TEJASC
Posts: 10
Joined: Fri Mar 14, 2014 2:51 pm
antibot: No, of course not.

Can I begin JFree Area Chart from Y-axis

Post by TEJASC » Fri Mar 14, 2014 3:19 pm

Hi,

I have recently came across with Jfree charts. And I am trying to draw a Simple Area Chart which starts from y-axis. For ex: Refer Image

Image

Though, this chart is constructed using Stacked Area chart, I need to achieve same using Simple Area Chart, where the rendering of Area begins from Y-axis (here in this image it begins from (0,1)). So, rendering of all series will always begin from (0,y).

Any help is appreciated.

Thanks in advance.

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

Re: Can I begin JFree Area Chart from Y-axis

Post by david.gilbert » Mon Mar 17, 2014 7:35 pm

I don't fully understand the question. You can control the shape of the end points of the area using the setEndType() method:

http://www.jfree.org/jfreechart/api/jav ... erEndType)

You can change the orientation of the chart using the plot's setOrientation() method:

http://www.jfree.org/jfreechart/api/jav ... ientation)

If those don't help, you will have to give a better explanation of what you are trying to achieve.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

TEJASC
Posts: 10
Joined: Fri Mar 14, 2014 2:51 pm
antibot: No, of course not.

Re: Can I begin JFree Area Chart from Y-axis

Post by TEJASC » Wed Mar 19, 2014 9:56 am

Thanks a lot, it worked for me. I was trying to plot series starting from y-axis, which I did using:

Code: Select all

AreaRenderer renderer = new AreaRenderer();
renderer.setEndType(AreaRendererEndType.LEVEL);
CategoryPlot categoryplot = (CategoryPlot)jfreechart.getPlot();
categoryplot.setRenderer(renderer);
I got output that I was expecting:

Image

Thanks for reply and help!

Locked