• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DateTickMarkPosition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jfree.chart.axis.DateTickMarkPosition的典型用法代码示例。如果您正苦于以下问题:Java DateTickMarkPosition类的具体用法?Java DateTickMarkPosition怎么用?Java DateTickMarkPosition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DateTickMarkPosition类属于org.jfree.chart.axis包,在下文中一共展示了DateTickMarkPosition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testEquals

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的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.DateTickMarkPosition; //导入依赖的package包/类
/**
 * Test equals() method.
 */
public void testEquals() {
    assertEquals(DateTickMarkPosition.START, DateTickMarkPosition.START);
    assertEquals(DateTickMarkPosition.MIDDLE, DateTickMarkPosition.MIDDLE);
    assertEquals(DateTickMarkPosition.END, DateTickMarkPosition.END);
    assertFalse(DateTickMarkPosition.START.equals(null));
    assertFalse(DateTickMarkPosition.START.equals(DateTickMarkPosition.END));
    assertFalse(DateTickMarkPosition.MIDDLE.equals(DateTickMarkPosition.END));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:DateTickMarkPositionTests.java


示例3: testEquals

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的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


示例4: testPreviousStandardDateYear

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的package包/类
/**
 * A basic check for the testPreviousStandardDate() method when the
 * tick unit is 1 year.
 */
public void testPreviousStandardDateYear() {
    MyDateAxis axis = new MyDateAxis("Year");
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.set(2006, Calendar.AUGUST, 25, 12, 0);
    Date d1 = calendar.getTime();
    calendar.set(2007, Calendar.MAY, 20, 12, 0);
    Date d2 = calendar.getTime();
    axis.setRange(d1, d2);
    DateTickUnit unit = new DateTickUnit(DateTickUnit.YEAR, 1);
    axis.setTickUnit(unit);
    
    axis.setTickMarkPosition(DateTickMarkPosition.START);
    Date psd1 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd1);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.JANUARY, calendar.get(Calendar.MONTH));
    assertEquals(1, calendar.get(Calendar.DATE));
    
    axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
    Date psd2 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd2);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.JULY, calendar.get(Calendar.MONTH));
    assertEquals(1, calendar.get(Calendar.DATE));

    axis.setTickMarkPosition(DateTickMarkPosition.END);
    Date psd3 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd3);
    assertEquals(2005, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.DECEMBER, calendar.get(Calendar.MONTH));
    assertEquals(31, calendar.get(Calendar.DATE));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:DateAxisTests.java


示例5: testPreviousStandardDateMonth

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的package包/类
/**
 * A basic check for the testPreviousStandardDate() method when the
 * tick unit is 1 month.
 */
public void testPreviousStandardDateMonth() {
    MyDateAxis axis = new MyDateAxis("Month");
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.set(2006, Calendar.AUGUST, 25, 12, 0);
    Date d1 = calendar.getTime();
    calendar.set(2007, Calendar.MAY, 20, 12, 0);
    Date d2 = calendar.getTime();
    axis.setRange(d1, d2);
    DateTickUnit unit = new DateTickUnit(DateTickUnit.MONTH, 1);
    axis.setTickUnit(unit);
    
    axis.setTickMarkPosition(DateTickMarkPosition.START);
    Date psd1 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd1);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(1, calendar.get(Calendar.DATE));
    
    axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
    Date psd2 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd2);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(16, calendar.get(Calendar.DATE));

    axis.setTickMarkPosition(DateTickMarkPosition.END);
    Date psd3 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd3);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.JULY, calendar.get(Calendar.MONTH));
    assertEquals(31, calendar.get(Calendar.DATE));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:DateAxisTests.java


示例6: testPreviousStandardDateDay

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的package包/类
/**
 * A basic check for the testPreviousStandardDate() method when the
 * tick unit is 1 day.
 */
public void testPreviousStandardDateDay() {
    MyDateAxis axis = new MyDateAxis("Day");
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.set(2006, Calendar.AUGUST, 25, 12, 0);
    Date d1 = calendar.getTime();
    calendar.set(2007, Calendar.MAY, 20, 12, 0);
    Date d2 = calendar.getTime();
    axis.setRange(d1, d2);
    DateTickUnit unit = new DateTickUnit(DateTickUnit.DAY, 1);
    axis.setTickUnit(unit);
    
    axis.setTickMarkPosition(DateTickMarkPosition.START);
    Date psd1 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd1);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(25, calendar.get(Calendar.DATE));
    
    axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
    Date psd2 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd2);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(25, calendar.get(Calendar.DATE));

    axis.setTickMarkPosition(DateTickMarkPosition.END);
    Date psd3 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd3);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(24, calendar.get(Calendar.DATE));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:DateAxisTests.java


示例7: testPreviousStandardDateHour

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的package包/类
/**
 * A basic check for the testPreviousStandardDate() method when the
 * tick unit is 1 hour.
 */
public void testPreviousStandardDateHour() {
    MyDateAxis axis = new MyDateAxis("Hour");
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.set(2006, Calendar.AUGUST, 25, 12, 0);
    Date d1 = calendar.getTime();
    calendar.set(2007, Calendar.MAY, 20, 12, 0);
    Date d2 = calendar.getTime();
    axis.setRange(d1, d2);
    DateTickUnit unit = new DateTickUnit(DateTickUnit.HOUR, 1);
    axis.setTickUnit(unit);
    
    axis.setTickMarkPosition(DateTickMarkPosition.START);
    Date psd1 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd1);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(25, calendar.get(Calendar.DATE));
    assertEquals(12, calendar.get(Calendar.HOUR_OF_DAY));
    
    axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
    Date psd2 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd2);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(25, calendar.get(Calendar.DATE));
    assertEquals(11, calendar.get(Calendar.HOUR_OF_DAY));

    axis.setTickMarkPosition(DateTickMarkPosition.END);
    Date psd3 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd3);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(25, calendar.get(Calendar.DATE));
    assertEquals(11, calendar.get(Calendar.HOUR_OF_DAY));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:40,代码来源:DateAxisTests.java


示例8: testPreviousStandardDateMinute

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的package包/类
/**
 * A basic check for the testPreviousStandardDate() method when the
 * tick unit is 1 minute.
 */
public void testPreviousStandardDateMinute() {
    MyDateAxis axis = new MyDateAxis("Minute");
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.set(2006, Calendar.AUGUST, 25, 12, 0, 10);
    Date d1 = calendar.getTime();
    calendar.set(2007, Calendar.MAY, 20, 12, 0, 10);
    Date d2 = calendar.getTime();
    axis.setRange(d1, d2);
    DateTickUnit unit = new DateTickUnit(DateTickUnit.MINUTE, 1);
    axis.setTickUnit(unit);
    
    axis.setTickMarkPosition(DateTickMarkPosition.START);
    Date psd1 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd1);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(25, calendar.get(Calendar.DATE));
    assertEquals(12, calendar.get(Calendar.HOUR_OF_DAY));
    assertEquals(0, calendar.get(Calendar.MINUTE));
    
    axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
    Date psd2 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd2);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(25, calendar.get(Calendar.DATE));
    assertEquals(11, calendar.get(Calendar.HOUR_OF_DAY));
    assertEquals(59, calendar.get(Calendar.MINUTE));

    axis.setTickMarkPosition(DateTickMarkPosition.END);
    Date psd3 = axis.previousStandardDate(d1, unit);
    calendar.setTime(psd3);
    assertEquals(2006, calendar.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, calendar.get(Calendar.MONTH));
    assertEquals(25, calendar.get(Calendar.DATE));
    assertEquals(11, calendar.get(Calendar.HOUR_OF_DAY));
    assertEquals(59, calendar.get(Calendar.MINUTE));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:43,代码来源:DateAxisTests.java


示例9: testEquals

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的package包/类
/**
 * Test equals() method.
 */
public void testEquals() {
    assertEquals(DateTickMarkPosition.START, DateTickMarkPosition.START);
    assertEquals(DateTickMarkPosition.MIDDLE, DateTickMarkPosition.MIDDLE);
    assertEquals(DateTickMarkPosition.END, DateTickMarkPosition.END);
    assertFalse(DateTickMarkPosition.START.equals(null));
    assertFalse(
        DateTickMarkPosition.START.equals(DateTickMarkPosition.END)
    );
    assertFalse(
        DateTickMarkPosition.MIDDLE.equals(DateTickMarkPosition.END)
    );
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:DateTickMarkPositionTests.java


示例10: testHashCode

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashCode() {
    DateTickMarkPosition a1 = DateTickMarkPosition.END;
    DateTickMarkPosition a2 = DateTickMarkPosition.END;
    assertTrue(a1.equals(a2));
    int h1 = a1.hashCode();
    int h2 = a2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:DateTickMarkPositionTests.java


示例11: createAverageTeamDistanceGraph

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的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


示例12: createPlayerHistogram

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的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


示例13: createTeamGoldDifferenceGraph

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的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


示例14: createTeamXpDifferenceGraph

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的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


示例15: createChart

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的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


示例16: createChart

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的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


示例17: testEquals

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的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


示例18: testPreviousStandardDateMillisecondA

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的package包/类
/**
 * A basic check for the testPreviousStandardDate() method when the
 * tick unit is 1 millisecond.
 */
public void testPreviousStandardDateMillisecondA() {
    MyDateAxis axis = new MyDateAxis("Millisecond");
    Millisecond m0 = new Millisecond(458, 58, 31, 12, 1, 4, 2007);
    Millisecond m1 = new Millisecond(459, 58, 31, 12, 1, 4, 2007);

    Date d0 = new Date(m0.getFirstMillisecond());
    Date end = new Date(m1.getLastMillisecond());

    DateTickUnit unit = new DateTickUnit(DateTickUnitType.MILLISECOND, 1);
    axis.setTickUnit(unit);

    // START: check d0
    axis.setTickMarkPosition(DateTickMarkPosition.START);

    axis.setRange(d0, end);
    Date psd = axis.previousStandardDate(d0, unit);
    Date nsd = unit.addToDate(psd, TimeZone.getDefault());
    assertTrue(psd.getTime() < d0.getTime());
    assertTrue(nsd.getTime() >= d0.getTime());

    // MIDDLE: check d0
    axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);

    axis.setRange(d0, end);
    psd = axis.previousStandardDate(d0, unit);
    nsd = unit.addToDate(psd, TimeZone.getDefault());
    assertTrue(psd.getTime() < d0.getTime());
    assertTrue(nsd.getTime() >= d0.getTime());

    // END: check d0
    axis.setTickMarkPosition(DateTickMarkPosition.END);

    axis.setRange(d0, end);
    psd = axis.previousStandardDate(d0, unit);
    nsd = unit.addToDate(psd, TimeZone.getDefault());
    assertTrue(psd.getTime() < d0.getTime());
    assertTrue(nsd.getTime() >= d0.getTime());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:43,代码来源:DateAxisTests.java


示例19: testPreviousStandardDateMillisecondB

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的package包/类
/**
 * A basic check for the testPreviousStandardDate() method when the
 * tick unit is 10 milliseconds (just for the sake of having a multiple).
 */
public void testPreviousStandardDateMillisecondB() {
    MyDateAxis axis = new MyDateAxis("Millisecond");
    Millisecond m0 = new Millisecond(458, 58, 31, 12, 1, 4, 2007);
    Millisecond m1 = new Millisecond(459, 58, 31, 12, 1, 4, 2007);

    Date d0 = new Date(m0.getFirstMillisecond());
    Date end = new Date(m1.getLastMillisecond());

    DateTickUnit unit = new DateTickUnit(DateTickUnitType.MILLISECOND, 10);
    axis.setTickUnit(unit);

    // START: check d0
    axis.setTickMarkPosition(DateTickMarkPosition.START);

    axis.setRange(d0, end);
    Date psd = axis.previousStandardDate(d0, unit);
    Date nsd = unit.addToDate(psd, TimeZone.getDefault());
    assertTrue(psd.getTime() < d0.getTime());
    assertTrue(nsd.getTime() >= d0.getTime());

    // MIDDLE: check d0
    axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);

    axis.setRange(d0, end);
    psd = axis.previousStandardDate(d0, unit);
    nsd = unit.addToDate(psd, TimeZone.getDefault());
    assertTrue(psd.getTime() < d0.getTime());
    assertTrue(nsd.getTime() >= d0.getTime());

    // END: check d0
    axis.setTickMarkPosition(DateTickMarkPosition.END);

    axis.setRange(d0, end);
    psd = axis.previousStandardDate(d0, unit);
    nsd = unit.addToDate(psd, TimeZone.getDefault());
    assertTrue(psd.getTime() < d0.getTime());
    assertTrue(nsd.getTime() >= d0.getTime());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:43,代码来源:DateAxisTests.java


示例20: testEquals

import org.jfree.chart.axis.DateTickMarkPosition; //导入依赖的package包/类
/**
 * Test equals() method.
 */
public void testEquals() {
    assertEquals(DateTickMarkPosition.START, DateTickMarkPosition.START);
    assertEquals(DateTickMarkPosition.MIDDLE, DateTickMarkPosition.MIDDLE);
    assertEquals(DateTickMarkPosition.END, DateTickMarkPosition.END);
    assertFalse(DateTickMarkPosition.START.equals(null));
    assertFalse(DateTickMarkPosition.START.equals(
            DateTickMarkPosition.END));
    assertFalse(DateTickMarkPosition.MIDDLE.equals(
            DateTickMarkPosition.END));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:14,代码来源:DateTickMarkPositionTests.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StringTokenizer类代码示例发布时间:2022-05-22
下一篇:
Java EMTextMessageBody类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap