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


Java StandardXYItemRenderer.setSeriesPaint方法代碼示例

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


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

示例1: addCashFlowAxis

import org.jfree.chart.renderer.xy.StandardXYItemRenderer; //導入方法依賴的package包/類
/**
 * Adds the cash flow axis to the plot.
 * @param plot the plot
 * @param dataset the cash flow dataset
 */
private static void addCashFlowAxis(XYPlot plot, TimeSeriesCollection dataset) {
    final NumberAxis cashAxis = new NumberAxis("Cash Flow Ratio");
    cashAxis.setAutoRangeIncludesZero(false);
    plot.setRangeAxis(1, cashAxis);
    plot.setDataset(1, dataset);
    plot.mapDatasetToRangeAxis(1, 1);
    final StandardXYItemRenderer cashFlowRenderer = new StandardXYItemRenderer();
    cashFlowRenderer.setSeriesPaint(0, Color.blue);
    plot.setRenderer(1, cashFlowRenderer);
}
 
開發者ID:ta4j,項目名稱:ta4j,代碼行數:16,代碼來源:CashFlowToChart.java

示例2: createChart

import org.jfree.chart.renderer.xy.StandardXYItemRenderer; //導入方法依賴的package包/類
/**
 * Creates a chart.
 *
 * @param dataset1  a dataset.
 *
 * @return A chart.
 */
private JFreeChart createChart(XYDataset dataset, long lastentry) {

	JFreeChart chart = ChartFactory.createTimeSeriesChart(
			name,  // title
			"time",      // x-axis label
			"temperature",     // y-axis label
			dataset,     // data
			true,        // create legend?
			true,               // generate tooltips?
			false               // generate URLs?
			);
	
	chart.setBackgroundPaint(Color.white);

	XYPlot plot = (XYPlot) chart.getPlot();        
	
	NumberAxis axis1 = new NumberAxis(getAxisName());
	axis1.setAutoRangeIncludesZero(isIncludeZero());
	plot.setRangeAxis(0, axis1);
	
	plot.setDataset(0, dataset);
	plot.mapDatasetToRangeAxis(1, 0);
	
	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);
	//TODO: SHADOWS OFF
	
	final StandardXYItemRenderer r1 = new StandardXYItemRenderer();
	plot.setRenderer(0, r1);
	r1.setSeriesPaint(0, Color.BLUE);
	r1.setSeriesPaint(1, Color.RED);
	r1.setSeriesPaint(2, Color.GREEN);
	
	//plot.setDomainAxis(new NumberAxis("time"));
	plot.setDomainAxis(new DateAxis());
	plot.getDomainAxis().setAutoRange(false);
	
	long begin = getRangeBegin(lastentry);
	long end = getRangeEnd(lastentry);
	
	plot.getDomainAxis().setRange(begin, end);
	
	return chart;
}
 
開發者ID:organicsmarthome,項目名稱:OSHv2,代碼行數:56,代碼來源:AbstractDrawer.java

示例3: createChart

import org.jfree.chart.renderer.xy.StandardXYItemRenderer; //導入方法依賴的package包/類
/**
 * Creates a chart.
 *
 * @param dataset1  a dataset.
 *
 * @return A chart.
 */
private JFreeChart createChart(XYDataset dataset, long lastentry) {

	JFreeChart chart = ChartFactory.createTimeSeriesChart(
			name,  // title
			"time",      // x-axis label
			"temperature",     // y-axis label
			dataset,     // data
			true,        // create legend?
			true,               // generate tooltips?
			false               // generate URLs?
			);
	
	chart.setBackgroundPaint(Color.white);

	XYPlot plot = (XYPlot) chart.getPlot();        
	
	NumberAxis axis1 = new NumberAxis(getAxisName());
	axis1.setAutoRangeIncludesZero(isIncludeZero());
	plot.setRangeAxis(0, axis1);
	
	plot.setDataset(0, dataset);
	plot.mapDatasetToRangeAxis(1, 0);
	
	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);
	//TODO: SHADOWS OFF
	
	final StandardXYItemRenderer r1 = new StandardXYItemRenderer();
	plot.setRenderer(0, r1);
	r1.setSeriesPaint(0, Color.BLUE);
	r1.setSeriesPaint(1, Color.RED);
	r1.setSeriesPaint(2, Color.GREEN);
	r1.setSeriesPaint(3, Color.BLACK);
	r1.setSeriesPaint(4, Color.ORANGE);
	
	//plot.setDomainAxis(new NumberAxis("time"));
	plot.setDomainAxis(new DateAxis());
	((DateAxis) plot.getDomainAxis()).setTimeZone(TimeZone.getTimeZone("GMT"));
	plot.getDomainAxis().setAutoRange(false);
	
	long begin = getRangeBegin(lastentry);
	long end = getRangeEnd(lastentry);
	
	plot.getDomainAxis().setRange(begin, end);
	
	return chart;
}
 
開發者ID:organicsmarthome,項目名稱:OSHv4,代碼行數:59,代碼來源:AbstractDrawer.java

示例4: createChart

import org.jfree.chart.renderer.xy.StandardXYItemRenderer; //導入方法依賴的package包/類
/**
	 * Creates a chart.
	 *
	 * @param dataset1  a dataset.
	 *
	 * @return A chart.
	 */
	private JFreeChart createChart(XYDataset[] dataset, long lastentry) {

		JFreeChart chart = ChartFactory.createTimeSeriesChart(
				name,  // title
				"time",      // x-axis label
				"temperature",     // y-axis label
				dataset[0],     // data
				true,        // create legend?
				true,               // generate tooltips?
				false               // generate URLs?
				);
		
		chart.setBackgroundPaint(Color.white);

		XYPlot plot = (XYPlot) chart.getPlot();        
		
		NumberAxis axis1 = new NumberAxis(getAxisName());
		axis1.setAutoRangeIncludesZero(isIncludeZero());
		plot.setRangeAxis(0, axis1);
		
		plot.setDataset(0, dataset[0]);
		plot.mapDatasetToRangeAxis(1, 0);
		
		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);
		//TODO: SHADOWS OFF
		
		final StandardXYItemRenderer r1 = new StandardXYItemRenderer();
		plot.setRenderer(0, r1);
		r1.setSeriesPaint(0, Color.BLUE);
		r1.setSeriesPaint(1, Color.RED);
		r1.setSeriesPaint(2, Color.GREEN);
//		
		
		NumberAxis axis2 = new NumberAxis(getAxisName2());
		axis1.setAutoRangeIncludesZero(isIncludeZero());
		plot.setRangeAxis(1, axis2);
		
		plot.setDataset(1, dataset[1]);
		plot.mapDatasetToRangeAxis(1, 1);
		
		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);
		//TODO: SHADOWS OFF
		
		final StandardXYItemRenderer r2 = new StandardXYItemRenderer();
		plot.setRenderer(1, r2);
		r2.setSeriesPaint(0, Color.BLACK);
		r2.setSeriesPaint(1, Color.ORANGE);
		
		//plot.setDomainAxis(new NumberAxis("time"));
		plot.setDomainAxis(new DateAxis());
		((DateAxis) plot.getDomainAxis()).setTimeZone(TimeZone.getTimeZone("GMT"));
		plot.getDomainAxis().setAutoRange(false);
		
		long begin = getRangeBegin(lastentry);
		long end = getRangeEnd(lastentry);
		
		plot.getDomainAxis().setRange(begin, end);
		
		return chart;
	}
 
開發者ID:organicsmarthome,項目名稱:OSHv4,代碼行數:78,代碼來源:Abstract2AxisDrawer.java

示例5: createHistogramChart

import org.jfree.chart.renderer.xy.StandardXYItemRenderer; //導入方法依賴的package包/類
private JFreeChart createHistogramChart() {

    XYBarRenderer renderer1 = new XYBarRenderer();
    renderer1.setSeriesPaint(0, Color.cyan);
    renderer1.setSeriesPaint(1, Color.pink);

    XYPlot histPlot = new XYPlot(histogramDataset, null, new NumberAxis("count"), renderer1);

    XYBarRenderer renderer2 = new XYBarRenderer();
    renderer2.setSeriesPaint(0, Color.green);
    renderer2.setSeriesPaint(1, Color.orange);
    renderer2.setUseYInterval(true);

    // weight and potential
    if (infoParser.isRobustBoost || infoParser.isAdaBoost || infoParser.isLogLossBoost) {
      StandardXYItemRenderer renderer3 = new StandardXYItemRenderer();
      renderer3.setSeriesPaint(0, Color.blue);
      renderer3.setSeriesPaint(1, Color.red);
      renderer3.setBaseStroke(new BasicStroke(2));

      StandardXYItemRenderer renderer4 = new StandardXYItemRenderer();
      renderer4.setSeriesPaint(0, Color.blue);
      renderer4.setSeriesPaint(1, Color.red);
      renderer4.setBaseStroke(new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 2, new float[] { 2 }, 0));

      histPlot.setDataset(1, weightDataset);
      histPlot.setRenderer(1, renderer3);

      histPlot.setDataset(2, potentialDataset);
      histPlot.setRenderer(2, renderer4);

      histPlot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
    }

    XYPlot fluctPlot = new XYPlot(fluctDataset, null, new NumberAxis("bin"), renderer2);

    double initialLocation = (upper_limit + lower_limit) / 2.0;
    histMarker = new IntervalMarker(initialLocation, initialLocation);
    histPlot.addDomainMarker(histMarker, Layer.BACKGROUND);
    fluctPlot.addDomainMarker(histMarker, Layer.BACKGROUND);

    // plot.setBackgroundPaint(Color.lightGray);
    // plot.setDomainGridlinePaint(Color.white);
    // plot.setRangeGridlinePaint(Color.white);

    CombinedDomainXYPlot combinedPlot = new CombinedDomainXYPlot(new NumberAxis("score"));
    combinedPlot.setGap(10.0);

    // add the subplots...
    ValueAxis axis = new NumberAxis();
    axis.setRange(rawData.getMinRange(iter), rawData.getMaxRange(iter));
    combinedPlot.add(histPlot, 3);
    combinedPlot.add(fluctPlot, 1);
    combinedPlot.setOrientation(PlotOrientation.VERTICAL);
    combinedPlot.setDomainAxis(axis);

    JFreeChart chart = new JFreeChart("Histogram", JFreeChart.DEFAULT_TITLE_FONT, combinedPlot, false // legend
        );

    return chart;
  }
 
開發者ID:sunsern,項目名稱:jboost,代碼行數:62,代碼來源:HistogramFrame.java


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