当前位置: 首页>>代码示例>>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;未经允许,请勿转载。