【发布时间】:2014-01-22 13:31:24
【问题描述】:
正如文档中所说:
"
/**
* Factory method to create a 15-min, 9:00 AM thought 4:00 PM, Monday
* through Friday SegmentedTimeline.
* <P>
* This timeline uses a segmentSize of FIFTEEN_MIN_SEGMENT_SIZE. The
* segment group is defined as 28 included segments (9:00 AM through
* 4:00 PM) and 68 excluded segments (4:00 PM through 9:00 AM the next day).
* <P>
* In order to exclude Saturdays and Sundays it uses a baseTimeline that
* only includes Monday through Friday days.
* <P>
* The <code>startTime</code> of the resulting timeline will be 9:00 AM
* after the startTime of the baseTimeline. This will correspond to 9:00 AM
* of the first Monday after 1/1/1900.
*
* @return A fully initialized SegmentedTimeline.
*/
public static SegmentedTimeline newFifteenMinuteTimeline()
"
这个方法的代码是:
"timeline.setBaseTimeline(newMondayThroughFridayTimeline());"
如果你只是搜索SegmentedTimeline baseTimeline的位置
被使用,你会看到,它被用于其他 3 种方法:
public void addBaseTimelineException(long domainValue) - 为 baseTimeline 添加了一些异常,
public void addBaseTimelineExclusions(long fromBaseDomainValue,
long toBaseDomainValue) - 这里也一样,并且
public SegmentedTimeline getBaseTimeline().
请注意,此 getter 不会在其他任何地方使用。
所以我的问题是,允许将周末作为例外添加到位于baseTimeline 之上的segmentedTimeline 的实现在哪里? 摘要:将 baseTimeline 添加到任何时间线都不会执行任何操作。
如何修改该类 (SegmentedTimeLine) 以制作时间线,类似于盘中 - 但周一到周五,以及每天上午 9 点到晚上 7 点?
【问题讨论】:
-
我知道,我可以将周末例外列表添加到我的即 segmentedtimeline = new SegmentedTimeLine(HOUR_SEGMENT_SIZE, 8, 16) 中,该列表从周一上午 9 点开始,但如果我们有,则为 3 年的数据,性能下降。
-
"但是如果我们有 3 年的数据,性能就会下降。" - 对不起,我的错,我的渲染器(CandlestickRenderer)设置为“setAutoWidthMethod(CandlestickRenderer.WIDTHMETHOD_SMALLEST);”这会降低性能:/
标签: java jfreechart timeline