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


Java JFreeChart.getXYPlot方法代碼示例

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


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

示例1: linePlot

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
public JFreeChart linePlot(String xLabel, String yLabel){
    int numDatasets = dataset.size();
    JFreeChart result = ChartFactory.createXYLineChart(
chartTitle, // chart title
xLabel, // x axis label
yLabel, // y axis label
dataset.get(0), // data
PlotOrientation.VERTICAL, 
true, // include legend
true, // tooltips
false // urls
    );
    XYPlot plot = result.getXYPlot();
    plot.getRenderer().setSeriesStroke(0, new BasicStroke(1.0f));
    plot.getRenderer().setSeriesPaint(0, seriesColor.get(0));
    for(int i=1;i<numDatasets;i++){
        plot.setDataset(i,dataset.get(i));
        //XYItemRenderer renderer = plot.getRenderer(i-0);
        //plot.setRenderer(i, new XYLineAndShapeRenderer(false, true));
        plot.getRenderer(i).setSeriesStroke(0, new BasicStroke(1.0f));
        plot.getRenderer(i).setSeriesPaint(0,seriesColor.get(i));
    }

    return result;
}
 
開發者ID:PacktPublishing,項目名稱:Neural-Network-Programming-with-Java-SecondEdition,代碼行數:26,代碼來源:Chart.java

示例2: scatterGridPlot

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
public JFreeChart scatterGridPlot(String xLabel, String yLabel){
    int numDatasets = dataset.size();
    JFreeChart result = ChartFactory.createScatterPlot(chartTitle
            , xLabel
            , yLabel
            , dataset.get(0));
    XYPlot plot = result.getXYPlot();
    plot.getRenderer().setSeriesStroke(0, new BasicStroke(1.0f));
    plot.getRenderer().setSeriesPaint(0, seriesColor.get(0));        
    for(int i=1;i<numDatasets;i++){
        plot.setDataset(i,dataset.get(i));
        //XYItemRenderer renderer = plot.getRenderer(i-0);
        plot.setRenderer(i, new XYLineAndShapeRenderer(true, true));
        plot.getRenderer(i).setSeriesStroke(0, new BasicStroke(1.0f));
        plot.getRenderer(i).setSeriesPaint(0,seriesColor.get(i));
    }

    return result;
}
 
開發者ID:PacktPublishing,項目名稱:Neural-Network-Programming-with-Java-SecondEdition,代碼行數:20,代碼來源:Chart.java

示例3: createChart

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
private JFreeChart createChart(final XYDataset dataset) {
	final JFreeChart chart = ChartFactory.createXYLineChart(
			"MONA KEY SIGNATURE GRAPH", "KeySignature per users ",
			"KeyGenerating time for task(secs) ", dataset,
			PlotOrientation.VERTICAL, true, true, false);
	chart.setBackgroundPaint(Color.white);
	final XYPlot plot1 = chart.getXYPlot();
	plot1.setBackgroundPaint(Color.lightGray);
	plot1.setDomainGridlinePaint(Color.white);
	plot1.setRangeGridlinePaint(Color.white);

	final XYPlot plot2 = chart.getXYPlot();
	plot2.setBackgroundPaint(Color.lightGray);
	plot2.setDomainGridlinePaint(Color.white);
	plot2.setRangeGridlinePaint(Color.white);

	final XYPlot plot3 = chart.getXYPlot();
	plot3.setBackgroundPaint(Color.lightGray);
	plot3.setDomainGridlinePaint(Color.white);
	plot3.setRangeGridlinePaint(Color.white);

	return chart;
}
 
開發者ID:cyberheartmi9,項目名稱:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud,代碼行數:24,代碼來源:KeySignatureGraph.java

示例4: createChart

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
private JFreeChart createChart(final XYDataset dataset) {
	final JFreeChart chart = ChartFactory.createXYLineChart(
			"MONA STORAGE GRAPH", "KeyGeneration per users ",
			"KeyGenerating size in Bytes", dataset,
			PlotOrientation.VERTICAL, true, true, false);
	chart.setBackgroundPaint(Color.white);
	final XYPlot plot1 = chart.getXYPlot();
	plot1.setBackgroundPaint(Color.lightGray);
	plot1.setDomainGridlinePaint(Color.white);
	plot1.setRangeGridlinePaint(Color.white);

	final XYPlot plot2 = chart.getXYPlot();
	plot2.setBackgroundPaint(Color.lightGray);
	plot2.setDomainGridlinePaint(Color.white);
	plot2.setRangeGridlinePaint(Color.white);

	final XYPlot plot3 = chart.getXYPlot();
	plot3.setBackgroundPaint(Color.lightGray);
	plot3.setDomainGridlinePaint(Color.white);
	plot3.setRangeGridlinePaint(Color.white);

	return chart;
}
 
開發者ID:cyberheartmi9,項目名稱:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud,代碼行數:24,代碼來源:KeyStorageGraph.java

示例5: createChart

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
private JFreeChart createChart(final XYDataset dataset) {
	final JFreeChart chart = ChartFactory.createXYLineChart("Auditing",
			"Fraction of Invalid Responses ", "Auding time for task(ms)",
			dataset, PlotOrientation.VERTICAL, true, true, false);
	chart.setBackgroundPaint(Color.white);
	final XYPlot plot1 = chart.getXYPlot();
	plot1.setBackgroundPaint(Color.lightGray);
	plot1.setDomainGridlinePaint(Color.white);
	plot1.setRangeGridlinePaint(Color.white);

	final XYPlot plot2 = chart.getXYPlot();
	plot2.setBackgroundPaint(Color.lightGray);
	plot2.setDomainGridlinePaint(Color.white);
	plot2.setRangeGridlinePaint(Color.white);

	final XYPlot plot3 = chart.getXYPlot();
	plot3.setBackgroundPaint(Color.lightGray);
	plot3.setDomainGridlinePaint(Color.white);
	plot3.setRangeGridlinePaint(Color.white);

	return chart;
}
 
開發者ID:cyberheartmi9,項目名稱:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud,代碼行數:23,代碼來源:MultiLineChart.java

示例6: createChart

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
private JFreeChart createChart(final XYDataset dataset) {
	final JFreeChart chart = ChartFactory.createXYLineChart(
			"MONA TIME AND COST GRAPH", "KeyGeneration Cost ",
			"KeyGenerating time for task(secs)", dataset,
			PlotOrientation.VERTICAL, true, true, false);
	chart.setBackgroundPaint(Color.white);
	final XYPlot plot1 = chart.getXYPlot();
	plot1.setBackgroundPaint(Color.lightGray);
	plot1.setDomainGridlinePaint(Color.white);
	plot1.setRangeGridlinePaint(Color.white);

	final XYPlot plot2 = chart.getXYPlot();
	plot2.setBackgroundPaint(Color.lightGray);
	plot2.setDomainGridlinePaint(Color.white);
	plot2.setRangeGridlinePaint(Color.white);

	final XYPlot plot3 = chart.getXYPlot();
	plot3.setBackgroundPaint(Color.lightGray);
	plot3.setDomainGridlinePaint(Color.white);
	plot3.setRangeGridlinePaint(Color.white);

	return chart;
}
 
開發者ID:cyberheartmi9,項目名稱:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud,代碼行數:24,代碼來源:TimeandCostGraph.java

示例7: scatterPlot

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
public JFreeChart scatterPlot(String xAxisLabel,String yAxisLabel){
    int numDatasets = dataset.size();
    JFreeChart result = ChartFactory.createScatterPlot(chartTitle
            , xAxisLabel
            , yAxisLabel
            , dataset.get(0));
    XYPlot plot = result.getXYPlot();
    switch(seriesTypes.get(0)){
            case DOTS:
                plot.setRenderer(0, new XYLineAndShapeRenderer(false, true));
                break;
            case LINES:
                plot.setRenderer(0, new XYLineAndShapeRenderer(true, true));
                break;
        }
    plot.getRenderer().setSeriesStroke(0, new BasicStroke(1.0f));
    plot.getRenderer().setSeriesPaint(0, seriesColor.get(0));        
    for(int i=1;i<numDatasets;i++){
        plot.setDataset(i,dataset.get(i));
        //XYItemRenderer renderer = plot.getRenderer(i-0);
        switch(seriesTypes.get(i)){
            case DOTS:
                plot.setRenderer(i, new XYLineAndShapeRenderer(false, true));
                break;
            case LINES:
                plot.setRenderer(i, new XYLineAndShapeRenderer(true, true));
                break;
        }
        plot.getRenderer(i).setSeriesStroke(0, new BasicStroke(1.0f));
        plot.getRenderer(i).setSeriesPaint(0,seriesColor.get(i));
    }

    return result;
}
 
開發者ID:PacktPublishing,項目名稱:Neural-Network-Programming-with-Java-SecondEdition,代碼行數:35,代碼來源:Chart.java

示例8: createXYLineChart

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
private static  JFreeChart createXYLineChart(String title,String category,String value, XYSeriesCollection dataset) {
	    JFreeChart mChart = ChartFactory.createXYLineChart(
	    		title,
	    		category,
	    		value,				
				dataset,
				PlotOrientation.VERTICAL,
				true, 
				true, 
				false);
//	      ChartPanel chartPanel = new ChartPanel( mChart);
//	      chartPanel.setPreferredSize( new java.awt.Dimension( 560 , 367 ) );
	      final XYPlot plot = mChart.getXYPlot();// 獲取折線圖plot對象
	      plot.setBackgroundPaint(new Color(240,240,240));
		  NumberAxis na= (NumberAxis)plot.getRangeAxis();
		  NumberAxis domainAxis = (NumberAxis)plot.getDomainAxis();
//		  na.setAutoTickUnitSelection(false);
		  na.setNumberFormatOverride(df);//設置軸坐標
		  domainAxis.setNumberFormatOverride(df);
	      XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer( );// 設置樣式
	      renderer.setBaseShapesVisible(false);
	      renderer.setSeriesPaint(0,Color.RED);
		  renderer.setSeriesPaint(1,Color.GREEN);
		  renderer.setSeriesPaint(2,new Color(255,150,24));
		  renderer.setSeriesPaint(3,new Color(82,101,115));
	      plot.setRenderer( renderer ); 
	      return mChart;
	}
 
開發者ID:dbiir,項目名稱:ts-benchmark,代碼行數:29,代碼來源:ChartBizUtil.java

示例9: createChartXY

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
/**
 * Creates a chart.
 *
 * @param dataset
 *            the data for the chart.
 *
 * @return a chart.
 */
private JFreeChart createChartXY(final XYDataset dataset) {

	// create the chart...
	final JFreeChart chart = ChartFactory.createXYLineChart("Line Chart Demo 6", // chart
																					// title
			"X", // x axis label
			"Y", // y axis label
			dataset, // data
			PlotOrientation.VERTICAL, true, // include legend
			true, // tooltips
			false // urls
	);

	// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
	chart.setBackgroundPaint(Color.white);

	// final StandardLegend legend = (StandardLegend) chart.getLegend();
	// legend.setDisplaySeriesShapes(true);

	// get a reference to the plot for further customisation...
	final XYPlot plot = chart.getXYPlot();
	plot.setBackgroundPaint(Color.lightGray);
	// plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0));
	plot.setDomainGridlinePaint(Color.white);
	plot.setRangeGridlinePaint(Color.white);

	final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
	renderer.setSeriesLinesVisible(0, false);
	renderer.setSeriesShapesVisible(1, false);
	plot.setRenderer(renderer);

	// change the auto tick unit selection to integer units only...
	final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
	rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
	// OPTIONAL CUSTOMISATION COMPLETED.

	return chart;

}
 
開發者ID:rototor,項目名稱:pdfbox-graphics2d,代碼行數:48,代碼來源:MultiPageTest.java

示例10: MultipleChartFactory

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
public MultipleChartFactory(String title, String xAxis) {
    super();
    String yAxis = title;
    XYSeriesCollection dataset = createDataset("Series");
    JFreeChart chart = ChartFactory.createXYLineChart("", xAxis, yAxis,
            dataset, PlotOrientation.VERTICAL, false, false, false);
    chart.setBackgroundPaint(Color.white);
    plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    ValueAxis axis = plot.getDomainAxis();
    axis.setAutoRange(true);
    NumberAxis rangeAxis2 = new NumberAxis("Range Axis 2");
    rangeAxis2.setAutoRangeIncludesZero(false);
    JPanel content = new JPanel(new BorderLayout());
    chartPanel = new ChartPanel(chart);
    content.add(chartPanel);

    CSVReader fileReader = new CSVReader();
    try {
        fileReader.read(plotChanelArray);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }


}
 
開發者ID:gransort,項目名稱:Java-oscilloscope-project,代碼行數:29,代碼來源:MultipleChartFactory.java

示例11: plot

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
public static void plot(double[] predicts, double[] actuals, String name) {
	double[] index = new double[predicts.length];
	for (int i = 0; i < predicts.length; i++)
		index[i] = i;
	int min = minValue(predicts, actuals);
	int max = maxValue(predicts, actuals);
	final XYSeriesCollection dataSet = new XYSeriesCollection();
	addSeries(dataSet, index, predicts, "Predicts");
	addSeries(dataSet, index, actuals, "Actuals");
	final JFreeChart chart = ChartFactory.createXYLineChart(
			"Prediction Result", // chart title
			"Index", // x axis label
			name, // y axis label
			dataSet, // data
			PlotOrientation.VERTICAL,
			true, // include legend
			true, // tooltips
			false // urls
	);
	XYPlot xyPlot = chart.getXYPlot();
	// X-axis
	final NumberAxis domainAxis = (NumberAxis) xyPlot.getDomainAxis();
	domainAxis.setRange((int) index[0], (int) (index[index.length - 1] + 2));
	domainAxis.setTickUnit(new NumberTickUnit(20));
	domainAxis.setVerticalTickLabels(true);
	// Y-axis
	final NumberAxis rangeAxis = (NumberAxis) xyPlot.getRangeAxis();
	rangeAxis.setRange(min, max);
	rangeAxis.setTickUnit(new NumberTickUnit(50));
	final ChartPanel panel = new ChartPanel(chart);
	final JFrame f = new JFrame();
	f.add(panel);
	f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
	f.pack();
	f.setVisible(true);
}
 
開發者ID:IsaacChanghau,項目名稱:StockPrediction,代碼行數:37,代碼來源:PlotUtil.java

示例12: createChart

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
protected JFreeChart createChart(XYDataset dataset) {
    // create the chart...
    final JFreeChart chart = ChartFactory.createXYLineChart("Quantidade de pixels", "Pixel", "Quantidade", dataset,
            PlotOrientation.VERTICAL, true, // include legend
            true, // tooltips
            false // urls
    );

    chart.setBackgroundPaint(java.awt.Color.white);

    // final StandardLegend legend = (StandardLegend) chart.getLegend();
    // legend.setDisplaySeriesShapes(true);

    // get a reference to the plot for further customisation...
    final XYPlot plot = chart.getXYPlot();
    plot.setBackgroundPaint(java.awt.Color.lightGray);
    // plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0));
    plot.setDomainGridlinePaint(java.awt.Color.white);
    plot.setRangeGridlinePaint(java.awt.Color.white);

    // change the auto tick unit selection to integer units only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    // OPTIONAL CUSTOMISATION COMPLETED.

    return chart;
}
 
開發者ID:nbfontana,項目名稱:pdi,代碼行數:28,代碼來源:Interface.java

示例13: createChart

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
private JFreeChart createChart(String chartContent, String title, String yaxisName){
    //創建時序圖對象
    XYSeries = new XYSeries(chartContent);
    XYSeriesCollection xySeriesCollection=new XYSeriesCollection(XYSeries);

    // 設置中文主題樣式 解決亂碼
    StandardChartTheme chartTheme = new StandardChartTheme("CN");
    // 設置標題字體
    chartTheme.setExtraLargeFont(font);
    // 設置圖例的字體
    chartTheme.setRegularFont(font);
    // 設置軸向的字體
    chartTheme.setLargeFont(font);
    chartTheme.setSmallFont(font);

    ChartFactory.setChartTheme(chartTheme);

    JFreeChart jfreechart = ChartFactory.createXYLineChart(title,"幀數",yaxisName,xySeriesCollection);
    XYPlot xyplot = jfreechart.getXYPlot();
    //縱坐標設定
    ValueAxis valueaxis = xyplot.getDomainAxis();
    //自動設置數據軸數據範圍
    valueaxis.setAutoRange(true);
    //數據軸固定數據範圍 30s
    //valueaxis.setFixedAutoRange(100);

    valueaxis = xyplot.getRangeAxis();

    return jfreechart;
}
 
開發者ID:ZingBug,項目名稱:NystagmusJava,代碼行數:31,代碼來源:WaveChart.java

示例14: main

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
public static void main(String[] args) {
    /**
     * Getting time series
     */
    TimeSeries series = CsvTradesLoader.loadBitstampSeries();
    
    /**
     * Creating the OHLC dataset
     */
    OHLCDataset ohlcDataset = createOHLCDataset(series);
    
    /**
     * Creating the additional dataset
     */
    TimeSeriesCollection xyDataset = createAdditionalDataset(series);
    
    /**
     * Creating the chart
     */
    JFreeChart chart = ChartFactory.createCandlestickChart(
            "Bitstamp BTC price",
            "Time",
            "USD",
            ohlcDataset,
            true);
    // Candlestick rendering
    CandlestickRenderer renderer = new CandlestickRenderer();
    renderer.setAutoWidthMethod(CandlestickRenderer.WIDTHMETHOD_SMALLEST);
    XYPlot plot = chart.getXYPlot();
    plot.setRenderer(renderer);
    // Additional dataset
    int index = 1;
    plot.setDataset(index, xyDataset);
    plot.mapDatasetToRangeAxis(index, 0);
    XYLineAndShapeRenderer renderer2 = new XYLineAndShapeRenderer(true, false);
    renderer2.setSeriesPaint(index, Color.blue);
    plot.setRenderer(index, renderer2);
    // Misc
    plot.setRangeGridlinePaint(Color.lightGray);
    plot.setBackgroundPaint(Color.white);
    NumberAxis numberAxis = (NumberAxis) plot.getRangeAxis();
    numberAxis.setAutoRangeIncludesZero(false);
    plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
    
    /**
     * Displaying the chart
     */
    displayChart(chart);
}
 
開發者ID:ta4j,項目名稱:ta4j,代碼行數:50,代碼來源:CandlestickChart.java

示例15: createChart

import org.jfree.chart.JFreeChart; //導入方法依賴的package包/類
private JFreeChart createChart(final XYDataset dataset)
           
           {
       
       // create the chart...
       final JFreeChart chart = ChartFactory.createXYLineChart(
           "Line Chart Demo 6",      // chart title
           "X",                      // x axis label
           "Y",                      // y axis label
           dataset,                  // data
           PlotOrientation.VERTICAL,
           true,                     // include legend
           true,                     // tooltips
           false                     // urls
       );

       // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
       chart.setBackgroundPaint(Color.white);

//       final StandardLegend legend = (StandardLegend) chart.getLegend();
 //      legend.setDisplaySeriesShapes(true);
       
       // get a reference to the plot for further customisation...
       final XYPlot plot = chart.getXYPlot();
       plot.setBackgroundPaint(Color.lightGray);
   //    plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0));
       plot.setDomainGridlinePaint(Color.white);
       plot.setRangeGridlinePaint(Color.white);
       
       final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
       renderer.setSeriesLinesVisible(0, false);
       renderer.setSeriesShapesVisible(1, false);
       plot.setRenderer(renderer);

       // change the auto tick unit selection to integer units only...
       final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
       rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
       // OPTIONAL CUSTOMISATION COMPLETED.
               
       return chart;
       
   }
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:43,代碼來源:VisualizacionJfreechart.java


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