本文整理汇总了Java中org.jfree.chart.renderer.category.BarRenderer.setGradientPaintTransformer方法的典型用法代码示例。如果您正苦于以下问题:Java BarRenderer.setGradientPaintTransformer方法的具体用法?Java BarRenderer.setGradientPaintTransformer怎么用?Java BarRenderer.setGradientPaintTransformer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.category.BarRenderer
的用法示例。
在下文中一共展示了BarRenderer.setGradientPaintTransformer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureBarRenderer
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
private static void configureBarRenderer(BarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
StandardBarPainter barPainter = new StandardBarPainter();
renderer.setBarPainter(barPainter);
renderer.setGradientPaintTransformer(null);
ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
int seriesCount = valueSourceData.getSeriesCount();
DimensionConfig domainConfig = valueSource.getDomainConfig();
DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(
PlotDimension.COLOR);
SeriesFormat seriesFormat = valueSource.getSeriesFormat();
// Loop all series and set series format.
// Format based on dimension configs will be set later on in initFormatDelegate().
for (int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) {
// configure series paint if necessary
if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, colorDimensionConfig)) {
renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint());
}
// configure general style of the bars
renderer.setShadowVisible(false);
renderer.setSeriesOutlinePaint(seriesIdx, PlotConfiguration.DEFAULT_SERIES_OUTLINE_PAINT);
}
renderer.setDrawBarOutline(true);
}
示例2: createBarChart
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
@Override
protected JFreeChart createBarChart() throws JRException
{
JFreeChart jfreeChart = super.createBarChart();
CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
//categoryPlot.setOrientation(PlotOrientation.HORIZONTAL);
BarRenderer barRenderer = (BarRenderer)categoryPlot.getRenderer();
barRenderer.setItemMargin(0);
barRenderer.setGradientPaintTransformer(
new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL)
);
CategoryDataset categoryDataset = categoryPlot.getDataset();
if (categoryDataset != null)
{
for (int i = 0; i < categoryDataset.getRowCount(); i++)
{
barRenderer.setSeriesPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
}
}
return jfreeChart;
}
示例3: createStackedBarChart
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
@Override
protected JFreeChart createStackedBarChart() throws JRException
{
JFreeChart jfreeChart = super.createStackedBarChart();
CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
//categoryPlot.setOrientation(PlotOrientation.HORIZONTAL);
BarRenderer barRenderer = (BarRenderer)categoryPlot.getRenderer();
barRenderer.setItemMargin(0);
barRenderer.setGradientPaintTransformer(
new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL)
);
CategoryDataset categoryDataset = categoryPlot.getDataset();
if (categoryDataset != null)
{
for (int i = 0; i < categoryDataset.getRowCount(); i++)
{
barRenderer.setSeriesPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
}
}
return jfreeChart;
}
示例4: testEquals
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
BarRenderer r1 = new BarRenderer();
BarRenderer r2 = new BarRenderer();
assertTrue(r1.equals(r2));
assertTrue(r2.equals(r1));
// itemMargin
r1.setItemMargin(0.22);
assertFalse(r1.equals(r2));
r2.setItemMargin(0.22);
assertTrue(r1.equals(r2));
// drawBarOutline
r1.setDrawBarOutline(!r1.isDrawBarOutline());
assertFalse(r1.equals(r2));
r2.setDrawBarOutline(!r2.isDrawBarOutline());
assertTrue(r1.equals(r2));
// maxBarWidth
r1.setMaxBarWidth(0.11);
assertFalse(r1.equals(r2));
r2.setMaxBarWidth(0.11);
assertTrue(r1.equals(r2));
// minimumBarLength
r1.setMinimumBarLength(0.04);
assertFalse(r1.equals(r2));
r2.setMinimumBarLength(0.04);
assertTrue(r1.equals(r2));
// gradientPaintTransformer
r1.setGradientPaintTransformer(
new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_VERTICAL)
);
assertFalse(r1.equals(r2));
r2.setGradientPaintTransformer(
new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_VERTICAL)
);
assertTrue(r1.equals(r2));
// positiveItemLabelPositionFallback
r1.setPositiveItemLabelPositionFallback(
new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
);
assertFalse(r1.equals(r2));
r2.setPositiveItemLabelPositionFallback(
new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
);
assertTrue(r1.equals(r2));
// negativeItemLabelPositionFallback
r1.setNegativeItemLabelPositionFallback(
new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
);
assertFalse(r1.equals(r2));
r2.setNegativeItemLabelPositionFallback(
new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
);
assertTrue(r1.equals(r2));
}
示例5: testEquals
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
BarRenderer r1 = new BarRenderer();
BarRenderer r2 = new BarRenderer();
assertTrue(r1.equals(r2));
assertTrue(r2.equals(r1));
// base value
r1.setBase(0.123);
assertFalse(r1.equals(r2));
r2.setBase(0.123);
assertTrue(r1.equals(r2));
// itemMargin
r1.setItemMargin(0.22);
assertFalse(r1.equals(r2));
r2.setItemMargin(0.22);
assertTrue(r1.equals(r2));
// drawBarOutline
r1.setDrawBarOutline(!r1.isDrawBarOutline());
assertFalse(r1.equals(r2));
r2.setDrawBarOutline(!r2.isDrawBarOutline());
assertTrue(r1.equals(r2));
// maximumBarWidth
r1.setMaximumBarWidth(0.11);
assertFalse(r1.equals(r2));
r2.setMaximumBarWidth(0.11);
assertTrue(r1.equals(r2));
// minimumBarLength
r1.setMinimumBarLength(0.04);
assertFalse(r1.equals(r2));
r2.setMinimumBarLength(0.04);
assertTrue(r1.equals(r2));
// gradientPaintTransformer
r1.setGradientPaintTransformer(
new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_VERTICAL
)
);
assertFalse(r1.equals(r2));
r2.setGradientPaintTransformer(
new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_VERTICAL
)
);
assertTrue(r1.equals(r2));
// positiveItemLabelPositionFallback
r1.setPositiveItemLabelPositionFallback(
new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
);
assertFalse(r1.equals(r2));
r2.setPositiveItemLabelPositionFallback(
new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
);
assertTrue(r1.equals(r2));
// negativeItemLabelPositionFallback
r1.setNegativeItemLabelPositionFallback(
new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
);
assertFalse(r1.equals(r2));
r2.setNegativeItemLabelPositionFallback(
new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
);
assertTrue(r1.equals(r2));
}