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
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.
Can I begin JFree Area Chart from Y-axis
-
- 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
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.
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
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: Can I begin JFree Area Chart from Y-axis
Thanks a lot, it worked for me. I was trying to plot series starting from y-axis, which I did using:
I got output that I was expecting:
Thanks for reply and help!
Code: Select all
AreaRenderer renderer = new AreaRenderer();
renderer.setEndType(AreaRendererEndType.LEVEL);
CategoryPlot categoryplot = (CategoryPlot)jfreechart.getPlot();
categoryplot.setRenderer(renderer);
Thanks for reply and help!