本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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());
}
}
}
示例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;
}