当前位置: 首页>>代码示例>>Java>>正文


Java DateAxis.setTickMarkPosition方法代码示例

本文整理汇总了Java中org.jfree.chart.axis.DateAxis.setTickMarkPosition方法的典型用法代码示例。如果您正苦于以下问题:Java DateAxis.setTickMarkPosition方法的具体用法?Java DateAxis.setTickMarkPosition怎么用?Java DateAxis.setTickMarkPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.axis.DateAxis的用法示例。


在下文中一共展示了DateAxis.setTickMarkPosition方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testEquals

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    
    DateAxis a1 = new DateAxis("Test");
    DateAxis a2 = new DateAxis("Test");
    assertTrue(a1.equals(a2));
    
    // tickUnit 
    a1.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 7));
    assertFalse(a1.equals(a2));
    a2.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 7));
    assertTrue(a1.equals(a2));

    // dateFormatOverride 
    a1.setDateFormatOverride(new SimpleDateFormat("yyyy"));
    assertFalse(a1.equals(a2));
    a2.setDateFormatOverride(new SimpleDateFormat("yyyy"));
    assertTrue(a1.equals(a2));

    // tickMarkPosition
    a1.setTickMarkPosition(DateTickMarkPosition.END);
    assertFalse(a1.equals(a2));
    a2.setTickMarkPosition(DateTickMarkPosition.END);
    assertTrue(a1.equals(a2));
    
    // timeline
    a1.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());
    assertFalse(a1.equals(a2));
    a2.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());
    assertTrue(a1.equals(a2));
    

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:36,代码来源:DateAxisTests.java

示例2: testEquals

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    
    DateAxis a1 = new DateAxis("Test");
    DateAxis a2 = new DateAxis("Test");
    assertTrue(a1.equals(a2));
    assertFalse(a1.equals(null));
    assertFalse(a1.equals("Some non-DateAxis object"));
    
    // tickUnit 
    a1.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 7));
    assertFalse(a1.equals(a2));
    a2.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 7));
    assertTrue(a1.equals(a2));

    // dateFormatOverride 
    a1.setDateFormatOverride(new SimpleDateFormat("yyyy"));
    assertFalse(a1.equals(a2));
    a2.setDateFormatOverride(new SimpleDateFormat("yyyy"));
    assertTrue(a1.equals(a2));

    // tickMarkPosition
    a1.setTickMarkPosition(DateTickMarkPosition.END);
    assertFalse(a1.equals(a2));
    a2.setTickMarkPosition(DateTickMarkPosition.END);
    assertTrue(a1.equals(a2));
    
    // timeline
    a1.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());
    assertFalse(a1.equals(a2));
    a2.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());
    assertTrue(a1.equals(a2));
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:DateAxisTests.java

示例3: createAverageTeamDistanceGraph

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public static JFreeChart createAverageTeamDistanceGraph( AppState state ) {
    final JFreeChart chart = ChartFactory.createTimeSeriesChart( GameStatisticsComponent.AVERAGE_TEAM_DISTANCE, // chart title
                    Statics.MILISECONDS, // x axis label
                    "", // y axis label
                    createAverageTeamDistanceDataSet( state ), // data
                    true, // include legend
                    true, // tooltips
                    false // urls
                    );
    final XYPlot plot = chart.getXYPlot();

    final DateAxis domainAxis = new DateAxis( Statics.TIME );
    domainAxis.setTickMarkPosition( DateTickMarkPosition.MIDDLE );
    domainAxis.setLowerMargin( 0.0 );
    domainAxis.setUpperMargin( 0.0 );
    plot.setDomainAxis( domainAxis );
    plot.setForegroundAlpha( 0.5f );
    plot.setDomainPannable( false );
    plot.setRangePannable( false );

    final NumberAxis rangeAxis = new NumberAxis( GameStatisticsComponent.AVERAGE_TEAM_DISTANCE );
    rangeAxis.setLowerMargin( 0.15 );
    rangeAxis.setUpperMargin( 0.15 );
    plot.setRangeAxis( rangeAxis );

    return chart;
}
 
开发者ID:petosorus,项目名称:dotalys-cli,代码行数:28,代码来源:ChartCreator.java

示例4: createPlayerHistogram

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public static JFreeChart createPlayerHistogram( String selectedItem, List<String> selectedValuesList, AppState state ) {
    final JFreeChart chart = ChartFactory.createXYLineChart( selectedItem, // chart title
                    Statics.MILISECONDS, // x axis label
                    "", // y axis label
                    createPlayerDataSet( selectedItem, selectedValuesList, state ), // data
                    PlotOrientation.VERTICAL, true, // include legend
                    true, // tooltips
                    false // urls
                    );

    final XYPlot plot = chart.getXYPlot();

    final DateAxis domainAxis = new DateAxis( Statics.TIME );
    domainAxis.setTickMarkPosition( DateTickMarkPosition.MIDDLE );
    domainAxis.setLowerMargin( 0.0 );
    domainAxis.setUpperMargin( 0.0 );
    plot.setDomainAxis( domainAxis );
    plot.setForegroundAlpha( 0.5f );
    plot.setDomainPannable( false );
    plot.setRangePannable( false );

    final NumberAxis rangeAxis = new NumberAxis( selectedItem );
    rangeAxis.setLowerMargin( 0.15 );
    rangeAxis.setUpperMargin( 0.15 );
    plot.setRangeAxis( rangeAxis );

    return chart;
}
 
开发者ID:petosorus,项目名称:dotalys-cli,代码行数:29,代码来源:ChartCreator.java

示例5: createTeamGoldDifferenceGraph

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public static JFreeChart createTeamGoldDifferenceGraph( AppState appState ) {
    final JFreeChart chart = ChartFactory.createTimeSeriesChart( GameStatisticsComponent.TEAM_XP, Statics.EXPERIENCE, "Time",
                    createTeamGoldDiffDataSet( appState ), true, // legend
                    true, // tool tips
                    false // URLs
                    );

    final XYDifferenceRenderer renderer = new XYDifferenceRenderer( Color.GREEN, Color.RED, false );

    renderer.setSeriesPaint( 0, Color.GREEN );
    renderer.setSeriesPaint( 1, Color.RED );
    final XYPlot plot = chart.getXYPlot();
    plot.setRenderer( renderer );

    final DateAxis domainAxis = new DateAxis( Statics.TIME );
    domainAxis.setTickMarkPosition( DateTickMarkPosition.MIDDLE );
    domainAxis.setLowerMargin( 0.0 );
    domainAxis.setUpperMargin( 0.0 );
    plot.setDomainAxis( domainAxis );
    plot.setForegroundAlpha( 0.5f );

    final NumberAxis rangeAxis = new NumberAxis( Statics.GOLD );
    rangeAxis.setLowerMargin( 0.15 );
    rangeAxis.setUpperMargin( 0.15 );
    plot.setRangeAxis( rangeAxis );
    return chart;
}
 
开发者ID:petosorus,项目名称:dotalys-cli,代码行数:28,代码来源:ChartCreator.java

示例6: createTeamXpDifferenceGraph

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public static JFreeChart createTeamXpDifferenceGraph( AppState state ) {
    final JFreeChart chart = ChartFactory.createTimeSeriesChart( GameStatisticsComponent.TEAM_XP, Statics.EXPERIENCE, "Time",
                    createTeamXPDiffDataSet( state ), true, // legend
                    true, // tool tips
                    false // URLs
                    );

    final XYDifferenceRenderer renderer = new XYDifferenceRenderer( Color.GREEN, Color.RED, false );

    renderer.setSeriesPaint( 0, Color.GREEN );
    renderer.setSeriesPaint( 1, Color.RED );
    final XYPlot plot = chart.getXYPlot();
    plot.setRenderer( renderer );

    final DateAxis domainAxis = new DateAxis( Statics.TIME );
    domainAxis.setTickMarkPosition( DateTickMarkPosition.MIDDLE );
    domainAxis.setLowerMargin( 0.0 );
    domainAxis.setUpperMargin( 0.0 );
    plot.setDomainAxis( domainAxis );
    plot.setForegroundAlpha( 0.5f );

    final NumberAxis rangeAxis = new NumberAxis( Statics.EXPERIENCE );
    rangeAxis.setLowerMargin( 0.15 );
    rangeAxis.setUpperMargin( 0.15 );
    plot.setRangeAxis( rangeAxis );
    return chart;

}
 
开发者ID:petosorus,项目名称:dotalys-cli,代码行数:29,代码来源:ChartCreator.java

示例7: createChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
protected  JFreeChart createChart(IntervalXYDataset dataset) {
      JFreeChart chart = ChartFactory.createXYBarChart(
          chartTitle,
          domainLabel,
          true,
          rangeLabel,
          dataset,
          PlotOrientation.VERTICAL,
          false,// !legendPanelOn,
          true,
          false
      );
     
      // then customise it a little...
// chart.addSubtitle(new TextTitle("Source: http://www.amnestyusa.org/abolish/listbyyear.do"));
  chart.setBackgroundPaint(Color.white);
      
      XYPlot plot = chart.getXYPlot();
      plot.setRenderer(new ClusteredXYBarRenderer());
XYItemRenderer renderer = plot.getRenderer();

      StandardXYToolTipGenerator generator = new StandardXYToolTipGenerator(
          "{1} = {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0")
      );
renderer.setBaseToolTipGenerator(generator);
      renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());

      plot.setBackgroundPaint(Color.lightGray);
      plot.setRangeGridlinePaint(Color.white);

      DateAxis axis = (DateAxis) plot.getDomainAxis();
      axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
      axis.setLowerMargin(0.01);
      axis.setUpperMargin(0.01);
//		setXSummary(dataset);  X  is time
      return chart;
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:38,代码来源:HistogramChartDemo3.java

示例8: createChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
protected  JFreeChart createChart(IntervalXYDataset dataset) {
      JFreeChart chart = ChartFactory.createXYBarChart(
          chartTitle,
          domainLabel,
          true,
          rangeLabel,
          dataset,
          PlotOrientation.VERTICAL,
          !legendPanelOn,
          true,
          false
      );


      // then customise it a little...
// chart.addSubtitle(new TextTitle("Source: http://www.amnestyusa.org/abolish/listbyyear.do"));
  chart.setBackgroundPaint(Color.white);
      
      XYPlot plot = chart.getXYPlot();
      plot.setRenderer(new ClusteredXYBarRenderer());
XYItemRenderer renderer = plot.getRenderer();

      StandardXYToolTipGenerator generator = new StandardXYToolTipGenerator(
          "{1} = {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0")
      );
renderer.setBaseToolTipGenerator(generator);
      renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());

      plot.setBackgroundPaint(Color.lightGray);
      plot.setRangeGridlinePaint(Color.white);

      DateAxis axis = (DateAxis) plot.getDomainAxis();
      axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
      axis.setLowerMargin(0.01);
      axis.setUpperMargin(0.01);
//		setXSummary(dataset);  X  is time
      return chart;
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:39,代码来源:XYBarChartDemo1.java

示例9: testEquals

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {

    DateAxis a1 = new DateAxis("Test");
    DateAxis a2 = new DateAxis("Test");
    assertTrue(a1.equals(a2));
    assertFalse(a1.equals(null));
    assertFalse(a1.equals("Some non-DateAxis object"));

    // tickUnit
    a1.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, 7));
    assertFalse(a1.equals(a2));
    a2.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, 7));
    assertTrue(a1.equals(a2));

    // dateFormatOverride
    a1.setDateFormatOverride(new SimpleDateFormat("yyyy"));
    assertFalse(a1.equals(a2));
    a2.setDateFormatOverride(new SimpleDateFormat("yyyy"));
    assertTrue(a1.equals(a2));

    // tickMarkPosition
    a1.setTickMarkPosition(DateTickMarkPosition.END);
    assertFalse(a1.equals(a2));
    a2.setTickMarkPosition(DateTickMarkPosition.END);
    assertTrue(a1.equals(a2));

    // timeline
    a1.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());
    assertFalse(a1.equals(a2));
    a2.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());
    assertTrue(a1.equals(a2));

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:37,代码来源:DateAxisTests.java

示例10: createWeeklyLoginChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
private byte[] createWeeklyLoginChart (int width, int height)
{
	IntervalXYDataset dataset1 = getWeeklyLoginsDataSet ();
       IntervalXYDataset dataset2 = getWeeklySiteUserDataSet ();
	
	if ((dataset1 == null) || (dataset2 == null)) {
		return generateNoDataChart(width, height);
	}
	
       // create plot ...
       XYItemRenderer renderer1 = new XYLineAndShapeRenderer(true, false);
       renderer1.setSeriesStroke(0, new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
       renderer1.setSeriesStroke(1, new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
	renderer1.setSeriesPaint(0, Color.RED);
	renderer1.setSeriesPaint(0, Color.BLUE);
       
       DateAxis domainAxis = new DateAxis("");
       domainAxis.setTickUnit (new DateTickUnit (DateTickUnit.DAY, 7, new SimpleDateFormat ("yyyy-MM-dd")));
       domainAxis.setTickMarkPosition (DateTickMarkPosition.START);
       domainAxis.setVerticalTickLabels (true);
	domainAxis.setLowerMargin (0.01);
	domainAxis.setUpperMargin (0.01);
       
       NumberAxis rangeAxis = new NumberAxis("count");
	rangeAxis.setStandardTickUnits (NumberAxis.createIntegerTickUnits ());
	
       XYPlot plot1 = new XYPlot(dataset1, null, rangeAxis, renderer1);
       plot1.setBackgroundPaint(Color.lightGray);
       plot1.setDomainGridlinePaint(Color.white);
       plot1.setRangeGridlinePaint(Color.white);
       
       // add a second dataset and renderer...
       XYItemRenderer renderer2 = new XYLineAndShapeRenderer(true, false);
       renderer2.setSeriesStroke(0, new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
       renderer2.setSeriesStroke(1, new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
       renderer2.setSeriesStroke(2, new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
       renderer2.setSeriesPaint(0, Color.GREEN);
       renderer2.setSeriesPaint(1, Color.BLACK);
       renderer2.setSeriesPaint(2, Color.CYAN);
       
       rangeAxis = new NumberAxis("count");
	rangeAxis.setStandardTickUnits (NumberAxis.createIntegerTickUnits ());

	XYPlot plot2 = new XYPlot(dataset2, null, rangeAxis, renderer2);
       plot2.setBackgroundPaint(Color.lightGray);
       plot2.setDomainGridlinePaint(Color.white);
       plot2.setRangeGridlinePaint(Color.white);
       
       CombinedDomainXYPlot cplot = new CombinedDomainXYPlot(domainAxis);
       cplot.add(plot1, 3);
       cplot.add(plot2, 2);
       cplot.setGap(8.0);
       cplot.setDomainGridlinePaint(Color.white);
       cplot.setDomainGridlinesVisible(true);

       // return a new chart containing the overlaid plot...
       JFreeChart chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT, cplot, false);
       LegendTitle legend = new LegendTitle(cplot);
       chart.addSubtitle(legend);		
	
	// set background
	chart.setBackgroundPaint (parseColor (statsManager.getChartBackgroundColor ()));

	// set chart border
	chart.setPadding (new RectangleInsets (10, 5, 5, 5));
	chart.setBorderVisible (true);
	chart.setBorderPaint (parseColor ("#cccccc"));

	// set anti alias
	chart.setAntiAlias (true);

	BufferedImage img = chart.createBufferedImage (width, height);
	final ByteArrayOutputStream out = new ByteArrayOutputStream();
	try{
		ImageIO.write(img, "png", out);
	}catch(IOException e){
		log.warn("Error occurred while generating SiteStats chart image data", e);
	}
	return out.toByteArray();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:81,代码来源:ServerWideReportManagerImpl.java


注:本文中的org.jfree.chart.axis.DateAxis.setTickMarkPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。