CategoryAxis shift data to left?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Ted Hill
Posts: 54
Joined: Mon Jun 12, 2006 7:39 pm

CategoryAxis shift data to left?

Post by Ted Hill » Mon Aug 24, 2009 8:27 pm

I have a line chart based on a DefaultCategoryDataset.

Along the x-axis, my labels start with '1' and increase, i.e. " 1 2 3 4 5 " etc.

There is a gap between the vertical y-axis and my first x,y data point (whose x-value is 1). I would like to minimize this gap by shifting the entire plot to the left.

I have played around a little with

Code: Select all

plot.getDomainAxis().setLowerMargin(value);
where 'value' is very small. Still there is a relatively large gap.

Does anyone know how to decrease this gap (or eliminate it entirely) ?

Thanks.
Ted Hill

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: CategoryAxis shift data to left?

Post by paradoxoff » Wed Aug 26, 2009 9:52 pm

See the discussion here and the suggested solutionin the linked thread.
Maybe one should add some items to the FAQ thread? :?: :!:

Locked