Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.DateAxis


                                            WindDataset dataset,
                                            boolean legend,
                                            boolean tooltips,
                                            boolean urls) {

        ValueAxis xAxis = new DateAxis(xAxisLabel);
        ValueAxis yAxis = new NumberAxis(yAxisLabel);
        yAxis.setRange(-12.0, 12.0);

        WindItemRenderer renderer = new WindItemRenderer();
        if (tooltips) {
View Full Code Here


            ProcessUtil process, List<String> phases, GapSkipTracker gaps) {
        JFreeChart result = ChartFactory.createXYBarChart(null, null, true,
            null, dataset, PlotOrientation.VERTICAL, false, true, false);

        XYPlot xyplot = (XYPlot) result.getPlot();
        DateAxis dateAxis = new DateAxis(null);
        dateAxis.setTickMarksVisible(false);
        dateAxis.setTickLabelsVisible(false);
        dateAxis.setLowerMargin(0.01);
        dateAxis.setUpperMargin(0.01);
        setupGaps(gaps, dateAxis, xyplot);
        xyplot.setDomainAxis(dateAxis);

        String[] phaseNameList = new String[phases.size()];
        for (int i = 0;  i < phaseNameList.length;  i++)
View Full Code Here

        yAxis.setTickLabelsVisible(false);
        yAxis.setTickMarksVisible(false);
        yAxis.setUpperMargin(0);

        // use a Date-based X-axis
        DateAxis xAxis = new DateAxis();

        // create an XY plot to display the data
        XYPlot plot = new XYPlot(chartData, xAxis, yAxis, renderer);
        plot.setOrientation(PlotOrientation.VERTICAL);
        plot.setRangeGridlinesVisible(false);
View Full Code Here

  private JFreeChart createTimeChart(ReportChart reportChart, ChartValue[] values, boolean displayInline)
  {
    XYDataset dataset = createTimeDataset(values);
   
    ValueAxis timeAxis = new DateAxis(reportChart.getXAxisLabel());
      NumberAxis valueAxis = new NumberAxis(reportChart.getYAxisLabel());     
    
      XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
        renderer.setBaseToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance());
       
View Full Code Here

  {
    JFreeChart chart = null;
   
    XYDataset dataset = createTimeDataset(values);
       
    ValueAxis timeAxis = new DateAxis(reportChart.getXAxisLabel());
    NumberAxis valueAxis = new NumberAxis(reportChart.getYAxisLabel());
   
    XYItemRenderer renderer = new XYBarRenderer();
    renderer.setBaseToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance());   
   
View Full Code Here

 
  private JFreeChart createStackedTimeBarChart(ReportChart reportChart, ChartValue[] values, boolean displayInline)
  {
    XYDataset dataset = createTimeDataset(values);
   
    ValueAxis timeAxis = new DateAxis(reportChart.getXAxisLabel());
    NumberAxis valueAxis = new NumberAxis(reportChart.getYAxisLabel());
   
    XYItemRenderer renderer = new StackedXYBarRenderer();
    renderer.setBaseToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance());
       
View Full Code Here

   
  private JFreeChart createTimeAreaChart(ReportChart reportChart, ChartValue[] values, boolean displayInline)
  {
    XYDataset dataset = createTimeDataset(values);
   
    ValueAxis timeAxis = new DateAxis(reportChart.getXAxisLabel());
      NumberAxis valueAxis = new NumberAxis(reportChart.getYAxisLabel());
     
      XYAreaRenderer renderer = new XYAreaRenderer();
        renderer.setBaseToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance());
       
View Full Code Here

            renderer.setShapesFilled(true);
        }


        // Set date axis style
        DateAxis axis = (DateAxis) plot.getDomainAxis();

        String formatString = "MM-dd HH";
        DateTickUnitType dtut = DateTickUnitType.HOUR;

        if (jComboGranularity.getSelectedItem().equals("Year")) {
            formatString = "yyyy";
            dtut = DateTickUnitType.YEAR;
        } else if (jComboGranularity.getSelectedItem().equals("Month")) {
            axis.setDateFormatOverride(new SimpleDateFormat("yyyy-MM"));
            dtut = DateTickUnitType.MONTH;
        } else if (jComboGranularity.getSelectedItem().equals("Day")) {
            axis.setDateFormatOverride(new SimpleDateFormat("MM-dd"));
            dtut = DateTickUnitType.DAY;
        } else if (jComboGranularity.getSelectedItem().equals("Minute")) {
            formatString = "MM-dd HH:mm";
            dtut = DateTickUnitType.MINUTE;
        } else if (jComboGranularity.getSelectedItem().equals("Second")) {
            formatString = "HH:mm:SS";
            dtut = DateTickUnitType.SECOND;
        }

        DateFormat formatter = new SimpleDateFormat(formatString);
        DateTickUnit unit = new DateTickUnit(dtut, 1, formatter);
        axis.setTickUnit(unit);

        ChartPanel chartPanel = new ChartPanel(chart);
        chartPanel.setPreferredSize(new java.awt.Dimension(800, 500));
        graphPanel.removeAll();
        graphPanel.add(chartPanel);
View Full Code Here

      case COMBINED_XY :
        final int layoutConst = getLayoutConstant(layout);
        Plot plot = null;
        switch (layoutConst) {
          case DOMAIN :
            ValueAxis domainAxis = new DateAxis(xAxisLabel);
            plot = new CombinedDomainXYPlot(domainAxis);
            for (int i = 0; i < plotDefinitions.size(); i++) {
              PlotDefinition pd = (PlotDefinition) plotDefinitions.get(i);
              check(pd.getDataset(), XYDataset.class, chartType);
              XYPlot temp = (XYPlot) pd.getPlot(chartTypeConst);
              NumberAxis na  = new NumberAxis(pd.getYaxislabel());
        if (pd.isYaxisinteger())
          na.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
              temp.setRangeAxis(na);
              ((CombinedDomainXYPlot) plot).add(temp);
            }
            return new JFreeChart(title, new Font("SansSerif", Font.BOLD, 18), plot, showLegend);
          case RANGE :
            ValueAxis rangeAxis = new NumberAxis(yAxisLabel);
            plot = new CombinedRangeXYPlot(rangeAxis);
      boolean allInteger = true;
            for (int i = 0; i < plotDefinitions.size(); i++) {
              PlotDefinition pd = (PlotDefinition) plotDefinitions.get(i);
        if (! pd.isYaxisinteger())
          allInteger = false;
              check(pd.getDataset(), XYDataset.class, chartType);
              XYPlot temp = (XYPlot) pd.getPlot(chartTypeConst);
              temp.setDomainAxis(new DateAxis(pd.getXaxislabel()));
              ((CombinedRangeXYPlot) plot).add(temp);
            }
      if (allInteger)
        ((NumberAxis) rangeAxis).setStandardTickUnits(NumberAxis.createIntegerTickUnits());
            return new JFreeChart(title, new Font("SansSerif", Font.BOLD, 18), plot, showLegend);
View Full Code Here

    }
   
  public Axis createAxis(int orientation, int type, String label) {
    switch (type) {
      case AXIS_TYPE_DATE :
        return new DateAxis(label);
      case AXIS_TYPE_NUMBER :
        return new NumberAxis(label);
      case AXIS_TYPE_CATEGORY://added by lrh 2005-07-11
              return new CategoryAxis(label);
      default:
View Full Code Here

TOP

Related Classes of org.jfree.chart.axis.DateAxis

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.