當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。