Package org.jCharts.properties

Examples of org.jCharts.properties.AxisProperties


      String[] axisLabels = {"January", "March", "May", "June"};
      DataSeries dataSeries = new DataSeries(axisLabels, "Months", "People", "Popular Events");
      dataSeries.addIAxisPlotDataSet(axisChartDataSet);

      ChartProperties chartProperties = new ChartProperties();
      AxisProperties axisProperties = new AxisProperties();
      axisProperties.setYAxisRoundValuesToNearest(0);
      LegendProperties legendProperties = new LegendProperties();

      AxisChart axisChart = new AxisChart(dataSeries, chartProperties, axisProperties, legendProperties, 500, 350);

      BufferedImage bufferedImage = new BufferedImage(500, 350, BufferedImage.TYPE_INT_RGB);
View Full Code Here


      DataSeries dataSeries = new DataSeries(labels, null, null, null);
      dataSeries.addIAxisPlotDataSet(axisChartDataSet);

      ChartProperties chartProperties = new ChartProperties();
      AxisProperties axisProperties = new AxisProperties();
      LegendProperties legendProperties = new LegendProperties();

      JRComponentElement element = fillContext.getComponentElement();
      AxisChart axisChart = new AxisChart(dataSeries, chartProperties, axisProperties, legendProperties,
          element.getWidth(), element.getHeight());
View Full Code Here

                    ChartType.LINE,
                    lineChartProperties );
            dataSeries.addIAxisPlotDataSet( axisChartDataSet );

            ChartProperties chartProperties = new ChartProperties();
            AxisProperties axisProperties = new AxisProperties();
            // show the grid lines, to turn it off, set it to zero
            axisProperties.getYAxisProperties().setShowGridLines(1);
            axisProperties.setXAxisLabelsAreVertical(true);
            // set the Y Axis to round
            DataAxisProperties daxp = (DataAxisProperties)axisProperties.getYAxisProperties();
            daxp.setRoundToNearest(1);
            LegendProperties legendProperties = new LegendProperties();
            AxisChart axisChart = new AxisChart(
                    dataSeries, chartProperties, axisProperties,
                    legendProperties, _width, _height );
View Full Code Here

                yaxis.setShowGridLines(1);
            } catch (PropertyException e) {
                log.warn("",e);
            }

            AxisProperties axisProperties= new AxisProperties(xaxis, yaxis);
            axisProperties.setXAxisLabelsAreVertical(true);
            LegendProperties legendProperties= new LegendProperties();
            AxisChart axisChart = new AxisChart(
                    dataSeries, chartProperties, axisProperties,
                    legendProperties, _width, _height );
            axisChart.setGraphics2D((Graphics2D) g);
View Full Code Here

        yaxis.setShowGridLines(1);

        LabelAxisProperties xaxis = new LabelAxisProperties();
        xaxis.setShowGridLines(1);

        AxisProperties axisProperties = new AxisProperties(xaxis, yaxis);
        axisProperties.setXAxisLabelsAreVertical(true);

        LegendProperties legendProperties = new LegendProperties();
        ChartProperties chartProperties = new ChartProperties();
        return new AxisChart(dataSeries, chartProperties, axisProperties, legendProperties, width, height);
    }
View Full Code Here

                    ChartType.LINE,
                    lineChartProperties );
            dataSeries.addIAxisPlotDataSet( axisChartDataSet );

            ChartProperties chartProperties = new ChartProperties();
            AxisProperties axisProperties = new AxisProperties();
            // show the grid lines, to turn it off, set it to zero
            axisProperties.getYAxisProperties().setShowGridLines(1);
            axisProperties.setXAxisLabelsAreVertical(true);
            // set the Y Axis to round
            DataAxisProperties daxp = (DataAxisProperties)axisProperties.getYAxisProperties();
            daxp.setRoundToNearest(1);
            LegendProperties legendProperties = new LegendProperties();
            AxisChart axisChart = new AxisChart(
                    dataSeries, chartProperties, axisProperties,
                    legendProperties, _width, _height );
View Full Code Here

        if (Debug.timingOn()) timer.timerString("[" + rname + "] Setup done, doing Event(s) and View(s)", module);

    try {
    String monthLabel[] = {"", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
    BarChartProperties properties = new BarChartProperties();
    AxisProperties axisProperties = new AxisProperties();
    axisProperties.setScaleFont( new Font( "Arial", Font.BOLD, 12 ) );
    axisProperties.setAxisTitleFont( new Font( "Arial", Font.BOLD, 12 ) );
    axisProperties.setYAxisUseDollarSigns(true);

    LineChartProperties lineChartProperties = new LineChartProperties(new BasicStroke());


    Paint[] paints= { new Color(100,150,100) };
    int width = 330;
    int height = 216;
    String xAxisTitle = " ";
    String yAxisTitle = " ";

    ArrayList xAxisLabels = new ArrayList();
    ArrayList legendLabels = new ArrayList();

    if(request.getParameter("report").equals("salesForQuarter")){
    double data[] = new double[3];
    Calendar cal = Calendar.getInstance();

    int month = cal.get(Calendar.MONTH) + 1;
    int year = cal.get(Calendar.YEAR);
    int quarterNumbers[] = CalendarUtil.getQuarterMonthNumbers(month, fyStartMonth);

    ArrayList list = new ArrayList();
    list.add(new EntityExpr("ownerId", EntityOperator.EQUALS, userInfo.getPartyId()));
    list.add(new EntityExpr("dealStatusId", EntityOperator.EQUALS, "10"));
    list.add(new EntityExpr("actualCloseDate", EntityOperator.LESS_THAN_EQUAL_TO, new java.sql.Date( CalendarUtil.getMaximumQuarterDate(cal.get(Calendar.MONTH) + 1, cal.get(Calendar.YEAR), fyStartMonth).getTime())));
    list.add(new EntityExpr("actualCloseDate", EntityOperator.GREATER_THAN_EQUAL_TO, new java.sql.Date( CalendarUtil.getMinimumQuarterDate(cal.get(Calendar.MONTH) + 1, cal.get(Calendar.YEAR), fyStartMonth).getTime())));

    ArrayList order = new ArrayList();
    order.add("actualCloseDate");

    java.util.List dealList = delegator.findByAnd("Deal", list, order);
    GenericValue dealValues[] = (GenericValue[])dealList.toArray(new GenericValue[0]);
    GenericValue dealValue = null;

    String months[] = CalendarUtil.getQuarterMonthNames(cal.get(Calendar.MONTH) + 1, fyStartMonth);
    for(int iz=0;iz<months.length;iz++){
      xAxisLabels.add((String)months[iz]);
    }

    xAxisTitle = "Month";
    yAxisTitle = "Sales";

    legendLabels.add("Pipeline for Quarter");

    for(int iz=0;iz<dealValues.length;iz++) {
      dealValue = dealValues[iz];
      Calendar calendar = Calendar.getInstance();
      calendar.setTime(dealValue.getDate("actualCloseDate"));

      if((calendar.get(Calendar.MONTH)+1)==quarterNumbers[0] && calendar.get(Calendar.YEAR)==year){
        data[0] = data[0] + dealValue.getDouble("amount").doubleValue();
      }
      if((calendar.get(Calendar.MONTH)+1)==quarterNumbers[1] && calendar.get(Calendar.YEAR)==year){
        data[1] = data[1] + dealValue.getDouble("amount").doubleValue();
      }
      if((calendar.get(Calendar.MONTH)+1)==quarterNumbers[2] && calendar.get(Calendar.YEAR)==year){
        data[2] = data[2] + dealValue.getDouble("amount").doubleValue();
      }
    }

      try {
      BarChart barChart = new BarChart(
        new SingleDataSet(
        data,
        (String[])legendLabels.toArray(new String[0]),
        (String[])xAxisLabels.toArray(new String[0]),
        paints,
        xAxisTitle,
        yAxisTitle ),
      false, properties, axisProperties, width, height );

      response.reset();
      response.setContentType("image/jpeg");
           
      barChart.exportJPG( response.getOutputStream(), 1.0f);
      response.getOutputStream().flush();
      } catch( Throwable throwable ) { throwable.printStackTrace();
      }
    }

    if(request.getParameter("report").equals("leadsForQuarter")){
    double data[] = new double[3];
    Calendar cal = Calendar.getInstance();

    int month = cal.get(Calendar.MONTH) + 1;
    int year = cal.get(Calendar.YEAR);
    int quarterNumbers[] = CalendarUtil.getQuarterMonthNumbers(month, fyStartMonth);

    ArrayList list = new ArrayList();
    list.add(new EntityExpr("leadOwnerId", EntityOperator.EQUALS, userInfo.getPartyId()));
    list.add(new EntityExpr("statusId", EntityOperator.EQUALS, "50"));
    list.add(new EntityExpr("convertedDate", EntityOperator.LESS_THAN_EQUAL_TO, new java.sql.Date( CalendarUtil.getMaximumQuarterDate(cal.get(Calendar.MONTH) + 1, cal.get(Calendar.YEAR), fyStartMonth).getTime())));
    list.add(new EntityExpr("convertedDate", EntityOperator.GREATER_THAN_EQUAL_TO, new java.sql.Date( CalendarUtil.getMinimumQuarterDate(cal.get(Calendar.MONTH) + 1, cal.get(Calendar.YEAR), fyStartMonth).getTime())));

    ArrayList order = new ArrayList();
    order.add("convertedDate");

    java.util.List dealList = delegator.findByAnd("Lead", list, order);
    GenericValue leadValues[] = (GenericValue[])dealList.toArray(new GenericValue[0]);
    GenericValue leadValue = null;

    String months[] = CalendarUtil.getQuarterMonthNames(cal.get(Calendar.MONTH) + 1, fyStartMonth);
    for(int iz=0;iz<months.length;iz++){
      xAxisLabels.add((String)months[iz]);
    }
    xAxisTitle = "Month";
    yAxisTitle = "Leads";

    legendLabels.add("Leads for Quarter");

    for(int iz=0;iz<leadValues.length;iz++) {
      leadValue = leadValues[iz];
      Calendar calendar = Calendar.getInstance();
      calendar.setTime(leadValue.getTimestamp("convertedDate"));

      if((calendar.get(Calendar.MONTH)+1)==quarterNumbers[0] && calendar.get(Calendar.YEAR)==year){
        data[0] = data[0] + 1;
      }
      if((calendar.get(Calendar.MONTH)+1)==quarterNumbers[1] && calendar.get(Calendar.YEAR)==year){
        data[1] = data[1] + 1;
      }
      if((calendar.get(Calendar.MONTH)+1)==quarterNumbers[2] && calendar.get(Calendar.YEAR)==year){
        data[2] = data[2] + 1;
      }
    }

    axisProperties.setYAxisUseDollarSigns(false);
    axisProperties.setYAxisRoundValuesToNearest(0);
//      axisProperties.setXAxisVerticalScaleFlag(true);

    try {
      BarChart barChart = new BarChart(
        new SingleDataSet(
View Full Code Here

                yaxis.setShowGridLines(1);
            } catch (PropertyException e) {
                log.warn("",e);
            }

            AxisProperties axisProperties= new AxisProperties(xaxis, yaxis);
            axisProperties.setXAxisLabelsAreVertical(true);
            LegendProperties legendProperties= new LegendProperties();
            legendProperties.setBorderStroke(null);
            legendProperties.setPlacement(legendPlacement);
            if (legendFont != null) {
                legendProperties.setFont(legendFont); //new Font("SansSerif", Font.PLAIN, 10)
View Full Code Here

                yaxis.setShowGridLines(1);
            } catch (PropertyException e) {
                log.warn("",e);
            }

            AxisProperties axisProperties= new AxisProperties(xaxis, yaxis);
            axisProperties.setXAxisLabelsAreVertical(true);
            LegendProperties legendProperties= new LegendProperties();
            legendProperties.setBorderStroke(null);
            legendProperties.setPlacement(legendPlacement);
            legendProperties.setIconBorderPaint(Color.WHITE);
            legendProperties.setIconBorderStroke(new BasicStroke(0f, BasicStroke.CAP_SQUARE, BasicStroke.CAP_SQUARE));
View Full Code Here

                yaxis.setShowGridLines(1);
            } catch (PropertyException e) {
                log.warn("",e);
            }

            AxisProperties axisProperties= new AxisProperties(xaxis, yaxis);
            axisProperties.setXAxisLabelsAreVertical(true);
            LegendProperties legendProperties= new LegendProperties();
            legendProperties.setBorderStroke(null);
            legendProperties.setPlacement(legendPlacement);
            legendProperties.setIconBorderPaint(Color.WHITE);
            if (legendPlacement == LegendAreaProperties.RIGHT || legendPlacement == LegendAreaProperties.LEFT) {
View Full Code Here

TOP

Related Classes of org.jCharts.properties.AxisProperties

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.