Page 1 of 1

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

Posted: Fri Dec 05, 2003 4:25 pm
by AdamM
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

Same Problem with me

Posted: Fri Dec 19, 2003 8:16 am
by ravionweb
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

Posted: Wed Dec 24, 2003 6:18 pm
by adam
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

It Works

Posted: Thu Jan 01, 2004 4:47 pm
by ravionweb
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

Posted: Fri Jul 21, 2006 11:02 am
by wzwei28

Posted: Thu Aug 03, 2006 3:43 am
by netmaster
I would also like to learn how to remove the gaps

Remove holidays

Posted: Wed Aug 30, 2006 5:08 am
by vuj2010
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.

Posted: Thu Aug 31, 2006 4:51 pm
by develop
you can also add good friday. but that has complex logic. if any one interested, i have implemented that

Thanks

Posted: Tue Jul 17, 2007 12:57 am
by clam61
is Holidays a class in jcommon? i cannot find it