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


Java DateAxis.setDateFormatOverride方法代码示例

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


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

示例1: createChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public static JFreeChart createChart( XYDataset dataset ) {

        JFreeChart chart = ChartFactory.createTimeSeriesChart(
                "",  // title
                QWIResources.getString( "x.axis" ),             // x-axis label
                QWIResources.getString( "y.axis" ),   // y-axis label
                dataset,            // data
                false,               // create legend?
                false,               // generate tooltips?
                false               // generate URLs?
        );

        XYPlot plot = (XYPlot)chart.getPlot();
        DateAxis axis = (DateAxis)plot.getDomainAxis();
        axis.setDateFormatOverride( new SimpleDateFormat( "ssss" ) );
        plot.getDomainAxis().setTickLabelsVisible( false );
        plot.getDomainAxis().setAutoRange( true );
        plot.getRangeAxis().setAutoRange( false );
        plot.getRangeAxis().setRange( -0.2, 0.2 );
        return chart;
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:22,代码来源:StripChartJFCNode.java

示例2: createChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public static JFreeChart createChart( XYDataset dataset ) {

        JFreeChart chart = ChartFactory.createTimeSeriesChart(
                "",  // title
                "x-axis",             // x-axis label
                "y-axis",   // y-axis label
                dataset,            // data
                false,               // create legend?
                false,               // generate tooltips?
                false               // generate URLs?
        );

        XYPlot plot = (XYPlot)chart.getPlot();
        DateAxis axis = (DateAxis)plot.getDomainAxis();
//        axis.setDateFormatOverride( new SimpleDateFormat( "MMM-yyyy" ) );
        axis.setDateFormatOverride( new SimpleDateFormat( "ssss" ) );
//        plot.setRangeGridlinesVisible( false );
//        plot.setDomainGridlinesVisible( false );
        return chart;
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:TestJFreeStripChart.java

示例3: addChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
private void addChart() {
  JFreeChart chart = ChartFactory.createXYLineChart(
    "Balance Graph for " + this.address, 
    "Time", 
    "Total Krist", 
    this.data, 
    PlotOrientation.VERTICAL, 
    false, 
    true, 
    false);
  XYPlot plot = chart.getXYPlot();
  DateAxis domain = new DateAxis();
  domain.setDateFormatOverride(new SimpleDateFormat("MMM dd, hh:mm a"));
  plot.setDomainAxis(domain);
  ChartPanel chartPanel = new ChartPanel(chart);
  setContentPane(chartPanel);
  revalidate();
  repaint();
}
 
开发者ID:apemanzilla,项目名称:KWallet,代码行数:20,代码来源:TransactionGraphFrame.java

示例4: initCPUChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public void initCPUChart(){
	cpuChart = ChartFactory.createTimeSeriesChart(
			CPU_USAGE, 
			"S", 
			CPU_USAGE, 
			cpuSet, 
			true, true, false);
    XYPlot localXYPlot = (XYPlot)cpuChart.getPlot();
    localXYPlot.setDomainPannable(true);
    localXYPlot.setRangePannable(false);
    localXYPlot.setDomainCrosshairVisible(true);
    localXYPlot.setRangeCrosshairVisible(true);
    XYItemRenderer r = localXYPlot.getRenderer();
       if (r instanceof XYLineAndShapeRenderer) {
           XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
           renderer.setBaseShapesVisible(true);
           renderer.setBaseShapesFilled(true);
       }
       
       DateAxis axis = (DateAxis) localXYPlot.getDomainAxis();
       axis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:23,代码来源:StatComposite.java

示例5: initMemChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public void initMemChart(){
	memChart = ChartFactory.createTimeSeriesChart(
			MEM_USED, 
			"Seconds",
			MEM_USED, 
			memSet, 
			true, true, false);
    XYPlot localXYPlot = (XYPlot)memChart.getPlot();
    localXYPlot.setDomainPannable(true);
    localXYPlot.setRangePannable(false);
    localXYPlot.setDomainCrosshairVisible(true);
    localXYPlot.setRangeCrosshairVisible(true);
    XYItemRenderer r = localXYPlot.getRenderer();
       if (r instanceof XYLineAndShapeRenderer) {
           XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
           renderer.setBaseShapesVisible(true);
           renderer.setBaseShapesFilled(true);
       }
       
       DateAxis axis = (DateAxis) localXYPlot.getDomainAxis();
       axis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:23,代码来源:StatComposite.java

示例6: initNetChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public void initNetChart(){
	netChart = ChartFactory.createTimeSeriesChart(
			BW_USAGE, 
			"Seconds",
			BW_USAGE, 
			netSet, 
			true, true, false);
    XYPlot localXYPlot = (XYPlot)netChart.getPlot();
    localXYPlot.setDomainPannable(true);
    localXYPlot.setRangePannable(false);
    localXYPlot.setDomainCrosshairVisible(true);
    localXYPlot.setRangeCrosshairVisible(true);
    XYItemRenderer r = localXYPlot.getRenderer();
       if (r instanceof XYLineAndShapeRenderer) {
           XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
           renderer.setBaseShapesVisible(true);
           renderer.setBaseShapesFilled(true);
       }
       
       DateAxis axis = (DateAxis) localXYPlot.getDomainAxis();
       axis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:23,代码来源:StatComposite.java

示例7: initCPUChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public void initCPUChart(){
	cpuChart = ChartFactory.createTimeSeriesChart(
			CPU_USAGE, 
			"S", 
			"percentage",//CPU_USAGE, 
			cpuSet, 
			true, true, false);
    XYPlot localXYPlot = (XYPlot)cpuChart.getPlot();
    localXYPlot.setDomainPannable(true);
    localXYPlot.setRangePannable(false);
    localXYPlot.setDomainCrosshairVisible(true);
    localXYPlot.setRangeCrosshairVisible(true);
    XYItemRenderer r = localXYPlot.getRenderer();
       if (r instanceof XYLineAndShapeRenderer) {
           XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
           renderer.setBaseShapesVisible(true);
           renderer.setBaseShapesFilled(true);
       }
       
       DateAxis axis = (DateAxis) localXYPlot.getDomainAxis();
       axis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:23,代码来源:WorkerStatData.java

示例8: initMemChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public void initMemChart(){
	memChart = ChartFactory.createTimeSeriesChart(
			MEM_USED, 
			"Seconds",
			"MB", //MEM_USED,
			memSet, 
			true, true, false);
    XYPlot localXYPlot = (XYPlot)memChart.getPlot();
    localXYPlot.setDomainPannable(true);
    localXYPlot.setRangePannable(false);
    localXYPlot.setDomainCrosshairVisible(true);
    localXYPlot.setRangeCrosshairVisible(true);
    XYItemRenderer r = localXYPlot.getRenderer();
       if (r instanceof XYLineAndShapeRenderer) {
           XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
           renderer.setBaseShapesVisible(true);
           renderer.setBaseShapesFilled(true);
       }
       
       DateAxis axis = (DateAxis) localXYPlot.getDomainAxis();
       axis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:23,代码来源:WorkerStatData.java

示例9: initNetChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public void initNetChart(){
	netChart = ChartFactory.createTimeSeriesChart(
			BW_USAGE, 
			"Seconds",
			"percentage",//BW_USAGE, 
			netSet, 
			true, true, false);
    XYPlot localXYPlot = (XYPlot)netChart.getPlot();
    localXYPlot.setDomainPannable(true);
    localXYPlot.setRangePannable(false);
    localXYPlot.setDomainCrosshairVisible(true);
    localXYPlot.setRangeCrosshairVisible(true);
    XYItemRenderer r = localXYPlot.getRenderer();
       if (r instanceof XYLineAndShapeRenderer) {
           XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
           renderer.setBaseShapesVisible(true);
           renderer.setBaseShapesFilled(true);
       }
       
       DateAxis axis = (DateAxis) localXYPlot.getDomainAxis();
       axis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:23,代码来源:WorkerStatData.java

示例10: createChartObject

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
private JFreeChart createChartObject(String title, TimeChartDefinition definition) {
    boolean legend = true;
    OHLCSeriesCollection ohlcSeriesCollection = new OHLCSeriesCollection();
    TimeSeriesCollection timeSeriesCollection = new TimeSeriesCollection();
    definition.ohlcSeries.forEach((seriesTitle, series) -> ohlcSeriesCollection.addSeries(series));
    definition.timeSeries.forEach((seriesTitle, series) -> timeSeriesCollection.addSeries(series));
    JFreeChart chartObject = ChartFactory.createCandlestickChart(
            title, "time", "price", ohlcSeriesCollection, legend);
    XYPlot xyPlot = chartObject.getXYPlot();
    NumberAxis numberAxis = (NumberAxis)xyPlot.getRangeAxis();
    DateAxis dateAxis = (DateAxis)xyPlot.getDomainAxis();
    dateAxis.setDateFormatOverride(new SimpleDateFormat("dd-LLL-yy hh:mm", Locale.ENGLISH));
    CandlestickRenderer renderer = (CandlestickRenderer)xyPlot.getRenderer();
    renderer.setAutoWidthMethod(CandlestickRenderer.WIDTHMETHOD_SMALLEST);
    for (int i = 0, size = definition.ohlcSeries.size(); i < size; ++i) {
        renderer.setSeriesPaint(i, Color.decode("#222222"));
    }
    numberAxis.setAutoRangeIncludesZero(false);
    addDatasetToPlot(xyPlot, timeSeriesCollection);
    return chartObject;
}
 
开发者ID:alphatica,项目名称:genotick,代码行数:22,代码来源:GenoJFreeChart.java

示例11: makeChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public static JFreeChart makeChart(String name, String currency, XYDataset dataset, boolean isMonth) {
	String timePeriod = "Day";
	if (isMonth) {
		timePeriod = "Month";
	}
	JFreeChart chart = ChartFactory.createTimeSeriesChart(name, timePeriod, "Price in " + currency, dataset);
	XYPlot plot = (XYPlot) chart.getPlot();
	
	DateAxis axis = (DateAxis) plot.getDomainAxis();
	if (isMonth) {
     axis.setDateFormatOverride(new SimpleDateFormat("MMM-yyyy"));
	} else {
		axis.setDateFormatOverride(new SimpleDateFormat("dd-MMM-yyyy"));
	}

   XYItemRenderer r = plot.getRenderer();
   if (r instanceof XYLineAndShapeRenderer) {
     XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
     renderer.setDrawSeriesLineAsPath(true);
     renderer.setBaseShapesVisible(true);
   }
   
	return chart;
}
 
开发者ID:CSTIB-Hotel,项目名称:OTCAnalyser,代码行数:25,代码来源:LineGraphMaker.java

示例12: Chart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
protected Chart(String title, String xAxisLabel, String yAxisLabel,  XYDataset ds) {
    this.title = title;
    chart = org.jfree.chart.ChartFactory.createXYLineChart("", yAxisLabel, xAxisLabel,
            ds, PlotOrientation.HORIZONTAL, true, false, false);
    XYPlot plot = (XYPlot) chart.getPlot();
    DateAxis rangeAxis = new DateAxis();
    rangeAxis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));
    plot.setRangeAxis(rangeAxis);
    plot.setDomainAxes(getYAxisFormat());
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(_WIDTH, _HEIGHT));
    chartPanel.setSize(_WIDTH, _HEIGHT);
    chartPanel.setPopupMenu(null);
    add(chartPanel);
    setSize(new Dimension(_WIDTH, _HEIGHT+35));
}
 
开发者ID:GideonLeGrange,项目名称:panstamp-tools,代码行数:17,代码来源:Chart.java

示例13: IOChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
 * 
 */
public IOChart(Composite parent, int style, String title) {
	super(parent,style);
	JFreeChart jfreechart = ChartFactory.createTimeSeriesChart(title, "Time", "Kbps", this.collection,true,true,false);
	XYPlot xyplot = jfreechart.getXYPlot();
	xyplot.setBackgroundPaint(Color.lightGray);
	xyplot.setDomainGridlinePaint(Color.white);
	xyplot.setRangeGridlinePaint(Color.white);
	xyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));
	xyplot.setDomainPannable(true);
	xyplot.setRangePannable(false);
	xyplot.setDomainCrosshairVisible(true);
	xyplot.setRangeCrosshairVisible(true);
	DateAxis dateaxis = (DateAxis)xyplot.getDomainAxis();
	dateaxis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));
	ChartUtilities.applyCurrentTheme(jfreechart);
	this.setLayout(new FillLayout());
	ChartComposite comp=new ChartComposite(this,SWT.NONE,jfreechart,true);
}
 
开发者ID:MToLinux,项目名称:VisualCenter,代码行数:22,代码来源:IOChart.java

示例14: createChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
private JFreeChart createChart(XYDataset dataset) {
  JFreeChart chart = ChartFactory.createTimeSeriesChart(
      "Pieces",
      "Time",
      "Pieces",
      dataset,
      true,
      false,
      false);
  chart.setBackgroundPaint(Color.white);

  XYPlot plot = (XYPlot) chart.getPlot();
  plot.setBackgroundPaint(Color.lightGray);
  plot.setDomainGridlinePaint(Color.white);
  plot.setRangeGridlinePaint(Color.white);
  plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
  plot.setDomainCrosshairVisible(true);
  plot.setRangeCrosshairVisible(true);

  DateAxis axis = (DateAxis) plot.getDomainAxis();
  axis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));

  return chart;
}
 
开发者ID:pmoor,项目名称:bitthief,代码行数:25,代码来源:PiecesStats.java

示例15: createChart

import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
private JFreeChart createChart(XYDataset dataset) {
  JFreeChart chart = ChartFactory.createTimeSeriesChart(
      "Open Connections",
      "Time",
      "Connections",
      dataset,
      true,
      false,
      false);
  chart.setBackgroundPaint(Color.white);

  XYPlot plot = (XYPlot) chart.getPlot();
  plot.setBackgroundPaint(Color.lightGray);
  plot.setDomainGridlinePaint(Color.white);
  plot.setRangeGridlinePaint(Color.white);
  plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
  plot.setDomainCrosshairVisible(true);
  plot.setRangeCrosshairVisible(true);

  DateAxis axis = (DateAxis) plot.getDomainAxis();
  axis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));

  return chart;
}
 
开发者ID:pmoor,项目名称:bitthief,代码行数:25,代码来源:OpenConnections.java


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