gpt4 book ai didi

java - 如何将 2 个 SegmentedTimelines 合并为 1?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:06:07 24 4
gpt4 key购买 nike

如文档中所述:

/**
* 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 未在其他任何地方使用。

所以我的问题是,允许将周末添加为 segmentedTimeline(高于 baseTimeline)的异常(exception)情况的实现在哪里?总结:将 baseTimeline 添加到任何时间线都没有任何作用。

如何修改该类 (SegmentedTimeLine) 以制作一个时间轴,它类似于一天中的某个时间 - 但周一至周五,以及每天上午 9 点至晚上 7 点?

最佳答案

这是 SegmentedTimeline 的一个实现问题,该问题仍未修复,而且(更糟的是)可能不会很快得到修复。 project leader said他可能会取消此功能或在未来的 JFreeChart 版本中实现一个新功能。

作为建议,基于类别轴的图表可能会帮助您显示数据集,而不必担心排除长(非交易时间段),尽管您可能需要重写一些方法来自定义域轴的显示。参见 http://www.jfree.org/jfreechart/api/javadoc/src-html/org/jfree/chart/demo/BarChartDemo1.html

关于java - 如何将 2 个 SegmentedTimelines 合并为 1?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21284313/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com