Stacked Area Chart With Continous Values

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
raunakkathuria
Posts: 16
Joined: Wed Dec 22, 2010 5:35 pm
antibot: No, of course not.
Location: India
Contact:

Stacked Area Chart With Continous Values

Post by raunakkathuria » Wed Dec 22, 2010 6:26 pm

Hi

I need to make a chart like image shown below (chart is made in ms-excel):

http://www.raunakkathuria.com/images/jf ... achart.jpg

The data is not continuous i.e it does not take into account the Saturday and Sunday or any holiday of week but excel still make it as continuous data.
(data is of 14 years with every day data provided except weekends and holidays).

I have already made the following graph in jfreechart

http://www.raunakkathuria.com/images/jf ... actual.jpg

but the data is not continuous as highlighted in the image.

Is there any way to make data continuous like in excel sheet.

Thanks
Raunak

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Re: Stacked Area Chart With Continous Values

Post by skunk » Wed Dec 22, 2010 7:02 pm

Assuming you are using an XYPlot with a DateAxis, you can use:

Code: Select all

dateAxis.setTimeline(SegmentedTimeLine.newMondayThroughFridayTimeline());

raunakkathuria
Posts: 16
Joined: Wed Dec 22, 2010 5:35 pm
antibot: No, of course not.
Location: India
Contact:

Re: Stacked Area Chart With Continous Values

Post by raunakkathuria » Wed Dec 22, 2010 8:26 pm

Hi

Thanks for your reply it improved the look and feel of the chart and is looking more continuous now. :)

One more thing in the same chart, I have used the following code for the tick unit on date axis

Code: Select all

DateTickUnit unit = null;
unit = new DateTickUnit(DateTickUnit.YEAR, 1);
axis.setTickUnit(unit);
But by default it starts from January, I want to make it configurable and set it according to the need.

Thanks for your previous answer.
Raunak

Locked