How to get rid of the gaps in the chart if the exch. closed?

Discussion about JFreeChart related to stockmarket charts.
Locked
AdamM
Posts: 4
Joined: Tue Nov 18, 2003 9:55 pm

How to get rid of the gaps in the chart if the exch. closed?

Post by AdamM » Fri Dec 05, 2003 4:25 pm

Hi All,

I am dealing with Stock Market Charts. I am using a TimeSeriesChart (with TimeSeriesCollection and BasicTimeSeries inside) for Tick Data and HighLowChart and CandlestickChart (wit CombinedDataset and DefaultHighLowDataset inside) for High/Low/Open/Close Data.

Please help me to get rid of the long straight lines (in case of Tick Data) and gaps (in case of High/Low Data) when the Exchange is closed, and therefore there is no data for that period. (I would like to even remove this part of the scale.)

Thanks,

Adam

ravionweb
Posts: 10
Joined: Tue Sep 23, 2003 3:22 pm
Location: India
Contact:

Same Problem with me

Post by ravionweb » Fri Dec 19, 2003 8:16 am

Hi Adam,

I also am plotting stock charts. Although I am using SegmentedTimeline.newMondayThroughFridayTimeline() method to supress Saturdays and Sundays but this is just not enough to supress non trading days during Monday and Friday.

Really looking towards a solution to this.

Ravi

adam

Post by adam » Wed Dec 24, 2003 6:18 pm

Hi Ravi,

I have checked the other topics with the same problem, I found a solution, but I have not tried yet.

Topic:

http://www.jfree.org/phpBB2/viewtopic.php?t=5931

Adam

ravionweb
Posts: 10
Joined: Tue Sep 23, 2003 3:22 pm
Location: India
Contact:

It Works

Post by ravionweb » Thu Jan 01, 2004 4:47 pm

Hi Adam,

Kingguppy had replied to my query itself long back and I didn't try it then :evil: but after you again showed me the link i did implement. addException(JList) really works. All you have to do is pass a list of Dates which are supposed to be excluded in this method of the SegmentedTimeLine and BINGO u have what u want. :)

Enjoy and yes thanks once again to kingguppy

Ravi

wzwei28
Posts: 105
Joined: Wed Mar 16, 2005 9:17 am
Location: Malaysia, Earth
Contact:

Post by wzwei28 » Fri Jul 21, 2006 11:02 am


netmaster
Posts: 1
Joined: Thu Aug 03, 2006 3:40 am
Contact:

Post by netmaster » Thu Aug 03, 2006 3:43 am

I would also like to learn how to remove the gaps

vuj2010
Posts: 11
Joined: Fri Apr 07, 2006 11:54 pm

Remove holidays

Post by vuj2010 » Wed Aug 30, 2006 5:08 am

This is how I do it:

SegmentedTimeline timeline = SegmentedTimeline.newMondayThroughFridayTimeline();

ArrayList alHDate = new ArrayList(); //HDate-Hide Date

Calendar now= Calendar.getInstance();
int iYear= now.get(Calendar.YEAR);

for (int iy=iYear-1;iy<=iYear;++iy){
alHDate.add(Holidays.NewYearsDayObserved(iy));
alHDate.add(Holidays.MartinLutherKingObserved(iy));
alHDate.add(Holidays.PresidentsDayObserved(iy));
alHDate.add(Holidays.MemorialDayObserved(iy));
alHDate.add(Holidays.IndependenceDayObserved(iy));
alHDate.add(Holidays.LaborDayObserved(iy));
alHDate.add(Holidays.ThanksgivingObserved(iy));
alHDate.add(Holidays.ChristmasDayObserved(iy));

}

timeline.addExceptions(alHDate);

m_timeAxis.setTimeline(timeline);

//you could add any closed day that you know.

develop
Posts: 296
Joined: Wed Mar 23, 2005 10:01 pm

Post by develop » Thu Aug 31, 2006 4:51 pm

you can also add good friday. but that has complex logic. if any one interested, i have implemented that

Thanks

clam61
Posts: 66
Joined: Tue Jul 03, 2007 9:59 pm

Post by clam61 » Tue Jul 17, 2007 12:57 am

is Holidays a class in jcommon? i cannot find it

Locked