Package net.sf.jasperreports.charts.design

Examples of net.sf.jasperreports.charts.design.JRDesignXyDataset


      case CHART_TYPE_PIE3D:
        dataset = new JRDesignPieDataset(dataset);
        plot = new JRDesignPie3DPlot(plot, this);
        break;
      case CHART_TYPE_SCATTER:
        dataset = new JRDesignXyDataset(dataset);
        plot = new JRDesignScatterPlot(plot, this);
        break;
      case CHART_TYPE_STACKEDBAR:
        dataset = new JRDesignCategoryDataset(dataset);
        plot = new JRDesignBarPlot(plot, this);
        break;
      case CHART_TYPE_STACKEDBAR3D:
        dataset = new JRDesignCategoryDataset(dataset);
        plot = new JRDesignBar3DPlot(plot, this);
        break;
      case CHART_TYPE_THERMOMETER:
        dataset = new JRDesignValueDataset(dataset);
        plot = new JRDesignThermometerPlot(plot, this);
        break;
      case CHART_TYPE_TIMESERIES:
        dataset = new JRDesignTimeSeriesDataset(dataset);//other datasets could be supported
        plot = new JRDesignTimeSeriesPlot(plot, this);
        break;
      case CHART_TYPE_XYAREA:
        dataset = new JRDesignXyDataset(dataset);
        plot = new JRDesignAreaPlot(plot, this);
        break;
      case CHART_TYPE_XYBAR:
        plot = new JRDesignBarPlot(plot, this);
        break;
      case CHART_TYPE_XYLINE:
        dataset = new JRDesignXyDataset(dataset);
        plot = new JRDesignLinePlot(plot, this);
        break;
      case CHART_TYPE_STACKEDAREA:
        dataset = new JRDesignCategoryDataset(dataset);
        plot = new JRDesignAreaPlot(plot, this);
View Full Code Here


   */
  public Object createObject(Attributes atts)
  {
    JRDesignChart chart = (JRDesignChart) digester.peek();
   
    JRDesignXyDataset dataset = null;
   
    if( chart.getDataset() == null ){
      dataset = new JRDesignXyDataset( chart.getDataset() );
    }
    else {
      dataset = (JRDesignXyDataset)chart.getDataset();
    }
   
View Full Code Here

  public List getSeries()  {
    return series;
  }
 
  public JRDesignChartDataset transform(DynamicJasperDesign design, String name, JRDesignGroup group, JRDesignGroup parentGroup, Map vars) {
    JRDesignXyDataset data = new JRDesignXyDataset(null);

    for (Iterator iterator = series.iterator(); iterator.hasNext();) {
      JRDesignXySeries serie = new JRDesignXySeries();
      AbstractColumn column = (AbstractColumn) iterator.next();
     
      //And use it as value for each bar
      JRDesignExpression varExp = getExpressionFromVariable((JRDesignVariable) vars.get(column));
      serie.setYValueExpression(varExp);
 
      //The key for each bar
      JRExpression exp2 = group.getExpression();
 
      JRDesignExpression exp3;
      if (seriesLabels.containsKey(column)) {
        exp3 = ExpressionUtils.createAndRegisterExpression(design, "dataset_" + column.getName() + "_" + name, (CustomExpression) seriesLabels.get(column));
      }
      else {
        exp3 = new JRDesignExpression();
        exp3.setText("\"" + column.getTitle() + "\"");
      }
      exp3.setValueClass(String.class);
     
      serie.setXValueExpression(exp2);
       
      serie.setLabelExpression(exp3);
      serie.setSeriesExpression(exp3);
       
      data.addXySeries(serie);
    }

    setResetStyle(data, group, parentGroup);

    return data;
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.charts.design.JRDesignXyDataset

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.