KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > plugin > jfreereport > reportcharts > LineChartExpression


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12 */

13 package org.pentaho.plugin.jfreereport.reportcharts;
14
15 import org.jfree.chart.ChartFactory;
16 import org.jfree.chart.JFreeChart;
17 import org.jfree.chart.plot.PlotOrientation;
18 import org.jfree.data.category.CategoryDataset;
19 import org.pentaho.core.session.IPentahoSession;
20
21 public class LineChartExpression extends CategoricalChartExpression {
22     
23     private static final long serialVersionUID = 816438776025760907L;
24
25   public LineChartExpression() {
26     super();
27   }
28   
29   public LineChartExpression(IPentahoSession session) {
30         super(session);
31         // TODO Auto-generated constructor stub
32
}
33
34     public JFreeChart getChart(CategoryDataset categoryDataset) {
35         JFreeChart rtn = null;
36         if (isThreeD()) {
37             rtn = ChartFactory.createLineChart3D(getTitle(), getCategoryAxisLabel(), getValueAxisLabel(), categoryDataset, isHorizontal() ? PlotOrientation.HORIZONTAL : PlotOrientation.VERTICAL, isShowLegend(), false, false);
38         } else {
39             rtn = ChartFactory.createLineChart(getTitle(), getCategoryAxisLabel(), getValueAxisLabel(), categoryDataset, isHorizontal() ? PlotOrientation.HORIZONTAL : PlotOrientation.VERTICAL, isShowLegend(), false, false);
40         }
41         return rtn;
42     }
43
44 }
45
Popular Tags