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


Java CategoryItemRenderer.setSeriesPaint方法代碼示例

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


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

示例1: testSetRenderer

import org.jfree.chart.renderer.category.CategoryItemRenderer; //導入方法依賴的package包/類
/**
 * A test for a bug where setting the renderer doesn't register the plot
 * as a RendererChangeListener.
 */
public void testSetRenderer() {
    CategoryPlot plot = new CategoryPlot();
    CategoryItemRenderer renderer = new LineAndShapeRenderer();
    plot.setRenderer(renderer);
    // now make a change to the renderer and see if it triggers a plot
    // change event...
    MyPlotChangeListener listener = new MyPlotChangeListener();
    plot.addChangeListener(listener);
    renderer.setSeriesPaint(0, Color.black);
    assertTrue(listener.getEvent() != null);
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:16,代碼來源:CategoryPlotTests.java

示例2: testSetRenderer

import org.jfree.chart.renderer.category.CategoryItemRenderer; //導入方法依賴的package包/類
/**
 * A test for a bug where setting the renderer doesn't register the plot
 * as a RendererChangeListener.
 */
@Test
public void testSetRenderer() {
    CategoryPlot plot = new CategoryPlot();
    CategoryItemRenderer renderer = new LineAndShapeRenderer();
    plot.setRenderer(renderer);
    // now make a change to the renderer and see if it triggers a plot
    // change event...
    MyPlotChangeListener listener = new MyPlotChangeListener();
    plot.addChangeListener(listener);
    renderer.setSeriesPaint(0, Color.black);
    assertTrue(listener.getEvent() != null);
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:17,代碼來源:CategoryPlotTest.java

示例3: testSetRenderer

import org.jfree.chart.renderer.category.CategoryItemRenderer; //導入方法依賴的package包/類
/**
 * A test for a bug where setting the renderer doesn't register the plot
 * as a RendererChangeListener.
 */
@Test
public void testSetRenderer() {
    CategoryPlot plot = new CategoryPlot();
    CategoryItemRenderer renderer = new LineAndShapeRenderer();
    plot.setRenderer(renderer);
    // now make a change to the renderer and see if it triggers a plot
    // change event...
    MyPlotChangeListener listener = new MyPlotChangeListener();
    plot.addChangeListener(listener);
    renderer.setSeriesPaint(0, Color.BLACK);
    assertTrue(listener.getEvent() != null);
}
 
開發者ID:jfree,項目名稱:jfreechart,代碼行數:17,代碼來源:CategoryPlotTest.java

示例4: configureAxisSeriesColors

import org.jfree.chart.renderer.category.CategoryItemRenderer; //導入方法依賴的package包/類
/**
 * The series colors set in the main plot of a multiple axis chart are used for
 * all the rendered charts in the plot.  This is a problem with multiple line
 * charts, using different scales and thus different axis.  All the lines will
 * be drawn using the first series color (since they are the first series for that
 * rendered) and it will be impossible to tell them apart.
 * <br><br>
 * For this reason we interpret series colors for charts included in a multiple
 * axis chart as specify absolute series colors for that renderer.
 *
 * @param renderer the renderer of the chart being created
 * @param jrPlot the Jasper view of that plot
 */
private void configureAxisSeriesColors(CategoryItemRenderer renderer, JRChartPlot jrPlot)
{
	SortedSet<JRSeriesColor> seriesColors = jrPlot.getSeriesColors();

	if (seriesColors != null)
	{
		Iterator<JRSeriesColor> iter = seriesColors.iterator();
		while (iter.hasNext())
		{
			JRSeriesColor seriesColor = iter.next();
			renderer.setSeriesPaint(seriesColor.getSeriesOrder(), seriesColor.getColor());
		}
	}
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:28,代碼來源:JRFillChart.java

示例5: createBarChart

import org.jfree.chart.renderer.category.CategoryItemRenderer; //導入方法依賴的package包/類
/**
 * Method to create a dual axis bar chart
 * 
 * @param itemsMeasured
 * @return
 */
public JFreeChart createBarChart(ItemMeasured itemsMeasured){
	
	JFreeChart chart = null;
	if (itemsMeasured != null) {
		String projectName = itemsMeasured.getName();
		
		try {
			createFactors(itemsMeasured);
			
			DefaultCategoryDataset barDataset = new DefaultCategoryDataset();
			DefaultCategoryDataset lineDataset = new DefaultCategoryDataset();
			
			populateProjectDataset(barDataset);
			populateFactorDataset(lineDataset);
			
			chart = ChartFactory.createBarChart3D(projectName, "Indicators", 
					"Measures Std. Dev.", barDataset,
					PlotOrientation.VERTICAL, true, true, false);
			chart.setBackgroundPaint(Color.white);
			
	        final CategoryPlot plot = chart.getCategoryPlot();
	        plot.setDomainGridlinesVisible(true);
	        plot.setDataset(1, lineDataset);
	        plot.mapDatasetToRangeAxis(1, 1);
	        plot.setDomainCrosshairVisible(true);
	        plot.setRangeCrosshairVisible(false);

	        final ValueAxis valueAxis = new NumberAxis("Factors Weights");
	        plot.setRangeAxis(1, valueAxis);
	        final CategoryItemRenderer renderer = new LineAndShapeRenderer();
	        renderer.setSeriesPaint(0, Color.blue);
	        renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
	        plot.setRenderer(1, renderer);
	        plot.setForegroundAlpha(0.7f);
	        
		} catch (Exception exception) {
			logger.error(exception);
		}
		
	}
		
	return chart;
}
 
開發者ID:mariazevedo88,項目名稱:o3smeasures-tool,代碼行數:50,代碼來源:BarChart.java


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