views:

39

answers:

1

Hi All,

I am building a set of chart displays, one of which is for a month display of daily trading - that is, one point of data per day (closing).

Since there is no trade during weekends and holidays, I need to discard these data points. Not only that, but data points should still appear adjacent to each other, regardless of any gaps in time. This can be seen in any such chart e.g. in the 3 month graph for Nasdaq on Yahoo Finance - see how weekends are skipped.

My question is: how should one correctly implement this in JFreeChart?

Thanks in advance!

+1  A: 

In addition to omitting the excluded data points, you can apply a SegmentedTimeline to the corresponding DateAxis. For example,

axis.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());
trashgod
Thanks, I'll try it.
Alex Arnon
Update: This does indeed work - however, for accuracy's sake we're building a new Timeline implementation, which will take additional factors into account. Thanks for the pointer, trashgod!
Alex Arnon