Quarterly Stacked Area Chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
hookumsnivy
Posts: 13
Joined: Mon Aug 14, 2006 9:14 pm

Quarterly Stacked Area Chart

Post by hookumsnivy » Mon Apr 30, 2007 10:33 pm

I'm trying to create a Stacked Area Chart over quarterly periods.

I'm using a TimeTableXYDataset and I create Quarter objects based on the following dates:
March 31, 2004
June 30, 2004
September 30, 2004
December 31, 2004
March 31, 2005
June 30, 2005
September 30, 2005
December 31, 2005
March 31, 2006
June 30, 2006
September 30, 2006
December 31, 2006

I have set the tick unit and the Tick Mark Position:

Code: Select all

        xAxis.setTickUnit(new DateTickUnit(DateTickUnit.MONTH, 3, dateFormat));
        xAxis.setTickMarkPosition(DateTickMarkPosition.END);
I have set some values on the dataset:

Code: Select all

        data.setDomainIsPointsInTime(true);
        data.setXPosition(TimePeriodAnchor.START);

though the last 2 statements seem to have no effect in my case.

The problem is that the chart skips the first point on the and labels the 2nd point w/ the 1st date.

For example, March 31, 2004 should have a value of 10 for the 1st area and June 30th should have a value of 20. The label Mar-04 is appearing for the June 30th value.

Also, the last tick mark on the chart is for September 06 instead of Decemeber 06.


Any ideas?

hookumsnivy
Posts: 13
Joined: Mon Aug 14, 2006 9:14 pm

Post by hookumsnivy » Tue May 01, 2007 5:14 pm

To simplify things:

The Y value at the origin does not have a tick label, and every label afterwards is 1 off.
ie. The first label should be at the origin, the 2nd label should be where the first label is, and so on.

Any help would be appreciated.

Locked