【问题标题】:How to add two TimeSeries JfreeChart如何添加两个 TimeSeries JfreeChart
【发布时间】:2015-06-19 07:33:02
【问题描述】:

我想添加两个或多个 timeSeries 以生成堆叠折线图。 我在 API 中找不到东西。我正在尝试手动操作,但仍然无法按我的意愿工作。 API中是否有任何功能可以管理这个? 谢谢

【问题讨论】:

    标签: jfreechart timeserieschart


    【解决方案1】:

    这很好用^^
    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);
                            }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多