Starting co-ordinate(plot) for X-axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
ranyeng
Posts: 13
Joined: Fri May 22, 2009 6:53 am

Starting co-ordinate(plot) for X-axis

Post by ranyeng » Thu Aug 06, 2009 10:46 am

In my line chart, when the values along the x-axis is very large in number, the first plotting point(1st co-ordinate) is started plotting far away from (0,0) point along x-axis. IF I want start plotting from (0,0) itself, what option I have to set.

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: Starting co-ordinate(plot) for X-axis

Post by david.gilbert » Sun Aug 09, 2009 8:59 pm

I don't entirely understand the question, but perhaps if you call setAutoRangeIncludesZero(false) for the axis then you'll get what you are looking for.
David Gilbert
JFreeChart Project Leader

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

ranyeng
Posts: 13
Joined: Fri May 22, 2009 6:53 am

Re: Starting co-ordinate(plot) for X-axis

Post by ranyeng » Mon Aug 17, 2009 6:18 am

H Dave,
Thanks for your reply. Still I am stuck. I wanted some kind of property set like categoryAxis.setLowerMargin(0); so the DomainAxis can be started from co-ordinate(0,0). After setting categoryAxis.setLowerMargin(0), the plot of first co-ordinate is not started from (0,0).

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

Re: Starting co-ordinate(plot) for X-axis

Post by david.gilbert » Mon Aug 17, 2009 7:47 pm

About the only information that you've added to your last post is that you have a category axis. I'm going to guess that you are drawing some kind of line chart - in this case, the data points are plotted in the middle of each category, so you'll never get the first data point hard up against the left of the plot - there will always be a gap of half a category.
David Gilbert
JFreeChart Project Leader

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

ranyeng
Posts: 13
Joined: Fri May 22, 2009 6:53 am

Re: Starting co-ordinate(plot) for X-axis

Post by ranyeng » Wed Aug 19, 2009 6:00 am

Thanks Dave. I got your point. With the reference of the topic
http://www.jfree.org/phpBB2/viewtopic.php?f=3&t=28316
I made some simulation, thus, it seems the plotting the first category starts from (0,0) itself.
It works properly for Line Chart, but it is not working for bar chart.

Or, is there some means to plot the points on left align of the category instead of centre of the category

Locked