當前位置: 首頁>>代碼示例>>Java>>正文


Java DateAxis.setLowerMargin方法代碼示例

本文整理匯總了Java中org.jfree.chart.axis.DateAxis.setLowerMargin方法的典型用法代碼示例。如果您正苦於以下問題:Java DateAxis.setLowerMargin方法的具體用法?Java DateAxis.setLowerMargin怎麽用?Java DateAxis.setLowerMargin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.axis.DateAxis的用法示例。


在下文中一共展示了DateAxis.setLowerMargin方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TimeSeriesViewObserver

import org.jfree.chart.axis.DateAxis; //導入方法依賴的package包/類
/**
 * 構造分時圖的全部元素
 */
public TimeSeriesViewObserver() {
	timeSeriesPrice = new TimeSeries("分時圖", Hour.class);
	timeSeriesPrice.add(new Hour(count++, day), StockSubject.OPENING_PRICE);
	timeSeriesPrice.setMaximumItemAge(MAXIMUM_ITEM_AGE);

	TimeSeriesCollection timeseriescollection = new TimeSeriesCollection();
	timeseriescollection.addSeries(timeSeriesPrice);
	DateAxis dateaxis = new DateAxis("時間");
	NumberAxis numberaxis = new NumberAxis("股票價格");
	dateaxis.setTickLabelFont(new Font("微軟雅黑", 0, 12));
	numberaxis.setTickLabelFont(new Font("微軟雅黑", 0, 12));
	dateaxis.setLabelFont(new Font("微軟雅黑", 0, 12));
	numberaxis.setLabelFont(new Font("微軟雅黑", 0, 12));

	XYLineAndShapeRenderer xylineandshaperenderer = new XYLineAndShapeRenderer(true, false);
	xylineandshaperenderer.setSeriesPaint(0, Color.red);
	xylineandshaperenderer.setSeriesStroke(0, new BasicStroke(1F, 0, 1));

	XYPlot xyplot = new XYPlot(timeseriescollection, dateaxis, numberaxis, xylineandshaperenderer);
	xyplot.setAxisOffset(new RectangleInsets(0D, 0D, 0D, 0D));
	dateaxis.setAutoRange(true);
	dateaxis.setLowerMargin(0.0D);
	dateaxis.setUpperMargin(0.0D);
	dateaxis.setTickLabelsVisible(true);
	numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

	JFreeChart chart = new JFreeChart("中國鐵通股票", new Font("微軟雅黑", 1, 12), xyplot, true);
	chartPanel = new ChartPanel(chart);
}
 
開發者ID:Sinton,項目名稱:DesignPatterns,代碼行數:33,代碼來源:TimeSeriesViewObserver.java

示例2: DataChart

import org.jfree.chart.axis.DateAxis; //導入方法依賴的package包/類
public DataChart(ComponentRegistry registry, String title, String yaxis) {
    DateAxis domain = new DateAxis("Time");
    NumberAxis range = new NumberAxis(yaxis);
    XYPlot xyplot = new XYPlot();
    xyplot.setDomainAxis(domain);
    xyplot.setRangeAxis(range);
 // xyplot.setBackgroundPaint(Color.black);
    xyplot.setDataset(dataset = new TimeSeriesCollection());

    DefaultXYItemRenderer renderer = new DefaultXYItemRenderer();
    renderer.setSeriesPaint(0, Color.red);
    renderer.setSeriesPaint(1, Color.green);
    renderer.setSeriesPaint(2, Color.blue);
    renderer.setSeriesPaint(3, Color.black);
//    renderer.setBaseStroke(
//        new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)
//    );
    renderer.setSeriesShapesVisible(0, false);
    renderer.setSeriesShapesVisible(1, false);
    renderer.setSeriesShapesVisible(2, false);
    renderer.setSeriesShapesVisible(3, false);
    xyplot.setRenderer(renderer);

    domain.setAutoRange(true);
    domain.setLowerMargin(0.0);
    domain.setUpperMargin(0.0);

    domain.setTickLabelsVisible(true);
    range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    JFreeChart chart = new JFreeChart(title,
        JFreeChart.DEFAULT_TITLE_FONT, xyplot, true);
    ChartPanel chartPanel = new ChartPanel(chart);
    setLayout(new BorderLayout());
    setPreferredSize(new Dimension(400, 200));
    add(chartPanel, BorderLayout.CENTER);
  }
 
開發者ID:PERSISTLab,項目名稱:BatterylessSim,代碼行數:37,代碼來源:DataChart.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: buildDateAxis

import org.jfree.chart.axis.DateAxis; //導入方法依賴的package包/類
private DateAxis buildDateAxis() {
    DateAxis dateAxis = new DateAxis();
    dateAxis.setDateFormatOverride(new SimpleDateFormat("yyyy-MM"));
    dateAxis.setLowerMargin(.02);
    dateAxis.setUpperMargin(.02);
    return dateAxis;
}
 
開發者ID:objektwerks,項目名稱:swing,代碼行數:8,代碼來源:TimeSeriesChartPanel.java

示例10: createChart

import org.jfree.chart.axis.DateAxis; //導入方法依賴的package包/類
private JFreeChart createChart(XYDataset xydataset) {
	JFreeChart jfreechart = ChartFactory.createXYLineChart("分數折線圖", "時間", "分數", xydataset,
			PlotOrientation.VERTICAL, true, true, false);

	Font font = new Font("宋體", Font.PLAIN, 13);
	jfreechart.getTitle().setFont(font);
	jfreechart.getLegend().setItemFont(font);
	jfreechart.getXYPlot().getDomainAxis().setTickLabelFont(font);
	jfreechart.getXYPlot().getDomainAxis().setLabelFont(font);
	jfreechart.getXYPlot().getRangeAxis().setTickLabelFont(font);
	jfreechart.getXYPlot().getRangeAxis().setLabelFont(font);

	XYPlot xyplot = (XYPlot) jfreechart.getPlot();
	xyplot.setDomainPannable(true);
	xyplot.setRangePannable(true);
	XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
	xylineandshaperenderer.setBaseShapesVisible(true);
	xylineandshaperenderer.setBaseShapesFilled(true);

	DateAxis dateaxis = new DateAxis("時間");
	dateaxis.setLowerMargin(0.0D);
	dateaxis.setUpperMargin(0.0D);

	SimpleDateFormat sfd = new SimpleDateFormat("yyyy-MM-dd HH:mm");
	dateaxis.setDateFormatOverride(sfd);
	xyplot.setDomainAxis(dateaxis);
	xyplot.setDomainAxis(dateaxis);

	xyplot.setForegroundAlpha(0.5F);

	return jfreechart;
}
 
開發者ID:jdepend,項目名稱:cooper,代碼行數:33,代碼來源:ExecuteHistoryChartPanel.java

示例11: configureDomainAxis

import org.jfree.chart.axis.DateAxis; //導入方法依賴的package包/類
/** Configures the domain axis. */
private void configureDomainAxis(DateAxis domainAxis) {
	domainAxis.setDateFormatOverride(new SimpleDateFormat(resolution
			.getDomainFormat()));

	if (useLogDateAxis) {
		domainAxis.setTimeline(new LogTimeLine());
		domainAxis.setTickUnit(new FixedDateTickUnit());
		domainAxis.setLowerMargin(0.0);
		domainAxis.setUpperMargin(0.0);
	}
}
 
開發者ID:vimaier,項目名稱:conqat,代碼行數:13,代碼來源:SeriesCreatorBase.java

示例12: createChart

import org.jfree.chart.axis.DateAxis; //導入方法依賴的package包/類
protected void createChart(String domainAxisTitle, String rangeAxisTitle, String chartsTitle, boolean includeLegend) {
    DateAxis domain = new DateAxis(domainAxisTitle);
    NumberAxis range = new NumberAxis(rangeAxisTitle);

    XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
    renderer.setSeriesPaint(0, Color.red);
    renderer.setSeriesPaint(1, Color.green);
    renderer.setSeriesPaint(2, Color.blue);
    renderer.setStroke(new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));

    XYPlot plot = new XYPlot(dataset, domain, range, renderer);
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));

    domain.setAutoRange(true);
    domain.setLowerMargin(0.0);
    domain.setUpperMargin(0.0);
    domain.setTickLabelsVisible(true);

    range.setAutoRange(false);
    range.setUpperBound(180);
    range.setLowerBound(-180);
    range.setAutoRangeIncludesZero(true);
    range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    chart = new JFreeChart(plot);
    chart.setBackgroundPaint(Color.white);
}
 
開發者ID:YangMann,項目名稱:drone-slam,代碼行數:31,代碼來源:AttitudeChart.java

示例13: createChart

import org.jfree.chart.axis.DateAxis; //導入方法依賴的package包/類
protected void createChart(String domainAxisTitle, String rangeAxisTitle, String chartsTitle, boolean includeLegend) {
        DateAxis domain = new DateAxis(domainAxisTitle);
        NumberAxis range = new NumberAxis(rangeAxisTitle);

        XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
        renderer.setSeriesPaint(0, Color.blue);
        renderer.setStroke(new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));

        XYPlot plot = new XYPlot(dataset, domain, range, renderer);
        plot.setBackgroundPaint(Color.lightGray);
        plot.setDomainGridlinePaint(Color.white);
        plot.setRangeGridlinePaint(Color.white);
        plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));

        domain.setAutoRange(true);
        domain.setLowerMargin(0.0);
        domain.setUpperMargin(0.0);
        domain.setTickLabelsVisible(true);

        range.setAutoRange(true);
//		range.setUpperBound(180);
//		range.setLowerBound(0);
        range.setAutoRangeIncludesZero(true);
        range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

        chart = new JFreeChart(plot);
        chart.setBackgroundPaint(Color.white);
    }
 
開發者ID:YangMann,項目名稱:drone-slam,代碼行數:29,代碼來源:AltitudeChart.java

示例14: createChart

import org.jfree.chart.axis.DateAxis; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
protected void createChart(String domainAxisTitle, String rangeAxisTitle, String chartsTitle, boolean includeLegend) 
{
	DateAxis domain = new DateAxis(domainAxisTitle);
	NumberAxis range = new NumberAxis(rangeAxisTitle);
	
	XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
	renderer.setSeriesPaint(0, Color.red);
	renderer.setSeriesPaint(1, Color.green);
	renderer.setSeriesPaint(2, Color.blue);
	renderer.setStroke(new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
	
	XYPlot plot = new XYPlot(dataset, domain, range, renderer);
	plot.setBackgroundPaint(Color.lightGray);
	plot.setDomainGridlinePaint(Color.white);
	plot.setRangeGridlinePaint(Color.white);
	plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
	
	domain.setAutoRange(true);
	domain.setLowerMargin(0.0);
	domain.setUpperMargin(0.0);
	domain.setTickLabelsVisible(true);
	
	range.setAutoRange(false);
	range.setUpperBound(90);
	range.setLowerBound(-90);
	range.setAutoRangeIncludesZero(true);
	range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
	
	chart = new JFreeChart(plot);
	chart.setBackgroundPaint(Color.white);
   }
 
開發者ID:Jupre,項目名稱:MarmaraDrone,代碼行數:33,代碼來源:AttitudeChart.java

示例15: setDateXAxis

import org.jfree.chart.axis.DateAxis; //導入方法依賴的package包/類
public XYChartBuilder setDateXAxis(final boolean showAxisValues)
{
  xAxis = new DateAxis();
  ((DateAxis) xAxis).setTickMarkPosition(DateTickMarkPosition.MIDDLE);
  xAxis.setLowerMargin(0.0);
  xAxis.setUpperMargin(0.0);
  xAxis.setVisible(showAxisValues);
  plot.setDomainAxis(xAxis);
  return this;
}
 
開發者ID:micromata,項目名稱:projectforge-webapp,代碼行數:11,代碼來源:XYChartBuilder.java


注:本文中的org.jfree.chart.axis.DateAxis.setLowerMargin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。