JfreeChart如何添加两个TimeSeries

How to add two TimeSeries JfreeChart

我想添加两个或多个 timeSeries 以生成堆积线图。 我在 API 中找不到任何内容。我正在尝试手动执行此操作,但仍然无法正常工作。 API 中是否有任何功能可以解决这个问题? 谢谢

很好,这很有效^^
rtp:RegulatTimePeriod 实例。 在遍历这两个系列的数据集时,如果当前 rtp 没有记录,我们使用此代码添加一个新节点,或者通过值的总和更新现有节点。

if(StackedSerie.getValue(rtp)!=null){         //stacked lines dataset
StackedSerie.addOrUpdate(rtp,(double)((float)v + StackedSerie.getValue(rtp).floatValue()));
                        }
                        else
                        {
                            StackedSerie.add(rtp,v);
                        }