How to get rid of the gaps in the chart if the exch. closed?
How to get rid of the gaps in the chart if the exch. closed?
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
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
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
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
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
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
Hi Adam,
Kingguppy had replied to my query itself long back and I didn't try it then
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
Kingguppy had replied to my query itself long back and I didn't try it then


Enjoy and yes thanks once again to kingguppy
Ravi
Remove holidays
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.
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.