本文整理汇总了Java中org.jfree.chart.renderer.category.BarRenderer.setShadowVisible方法的典型用法代码示例。如果您正苦于以下问题:Java BarRenderer.setShadowVisible方法的具体用法?Java BarRenderer.setShadowVisible怎么用?Java BarRenderer.setShadowVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.category.BarRenderer
的用法示例。
在下文中一共展示了BarRenderer.setShadowVisible方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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包/类
/**
* Creates the histogram chart.
*
* @return
*/
private JFreeChart createBarChart() {
JFreeChart chart = ChartFactory.createBarChart(null, null, null, createBarDataset(), PlotOrientation.VERTICAL,
false, false, false);
AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
chart.setBackgroundPaint(null);
chart.setBackgroundImageAlpha(0.0f);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setRangeGridlinesVisible(false);
plot.setDomainGridlinesVisible(false);
plot.setOutlineVisible(false);
plot.setRangeZeroBaselineVisible(false);
plot.setDomainGridlinesVisible(false);
plot.setBackgroundPaint(COLOR_INVISIBLE);
plot.setBackgroundImageAlpha(0.0f);
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.NOMINAL));
renderer.setBarPainter(new StandardBarPainter());
renderer.setDrawBarOutline(true);
renderer.setShadowVisible(false);
return chart;
}
示例3: applyTo
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
* Apply the chart style to the chart passed as parameter.
*
* @param chart the chart to apply the style to (is modified by the method)
* @param dataset the dataset associated with the chart
*/
public void applyTo(JFreeChart chart, final DefaultCategoryDataset dataset) {
CategoryPlot plot = (CategoryPlot) chart.getPlot();
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setBarPainter(new StandardBarPainter());
renderer.setDrawBarOutline(false);
renderer.setShadowVisible(false);
int seriesCount = dataset.getRowCount();
int coloursSize = colours.size();
int colourMod;
for (int series = 0; series < seriesCount; series++) {
colourMod = series % coloursSize;
renderer.setSeriesPaint(series, this.colours.get(colourMod));
}
}
示例4: makePlot
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
@Override
protected Plot makePlot(final JFreeChartBuilder.PlotParameters parameters) {
final DefaultKeyedValues2DDataset tmpDataset = this.getDataset();
final CategoryAxis tmpCategoryAxis = this.makeCategoryAxis(domain);
final NumberAxis tmpValueAxis = this.makeValueAxis(range);
final BarRenderer tmpRenderer = new BarRenderer();
tmpRenderer.setBarPainter(new StandardBarPainter());
tmpRenderer.setShadowVisible(false);
if (this.isTooltips()) {
tmpRenderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
}
if (this.isUrls()) {
tmpRenderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
}
this.setColours(tmpRenderer, tmpDataset);
final CategoryPlot retVal = new CategoryPlot(tmpDataset, tmpCategoryAxis, tmpValueAxis, tmpRenderer);
retVal.setOrientation(parameters.getOrientation());
retVal.setBackgroundPaint(parameters.getBackground());
retVal.setOutlinePaint(parameters.getOutline());
return retVal;
}
示例5: applyToCategoryItemRenderer
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
* Applies the settings of this theme to the specified renderer.
*
* @param renderer the renderer ({@code null} not permitted).
*/
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
Args.nullNotPermitted(renderer, "renderer");
if (renderer instanceof AbstractRenderer) {
applyToAbstractRenderer((AbstractRenderer) renderer);
}
renderer.setDefaultItemLabelFont(this.regularFont);
renderer.setDefaultItemLabelPaint(this.itemLabelPaint);
// now we handle some special cases - yes, UGLY code alert!
// BarRenderer
if (renderer instanceof BarRenderer) {
BarRenderer br = (BarRenderer) renderer;
br.setBarPainter(this.barPainter);
br.setShadowVisible(this.shadowVisible);
br.setShadowPaint(this.shadowPaint);
}
// StatisticalBarRenderer
if (renderer instanceof StatisticalBarRenderer) {
StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
}
// MinMaxCategoryRenderer
if (renderer instanceof MinMaxCategoryRenderer) {
MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
mmcr.setGroupPaint(this.errorIndicatorPaint);
}
}
示例6: createStackedBarChart
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
*
*/
protected JFreeChart createStackedBarChart() throws JRException
{
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createStackedBarChart(
evaluateTextExpression(getChart().getTitleExpression()),
evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
(CategoryDataset)getDataset(),
getPlot().getOrientationValue().getOrientation(),
isShowLegend(),
true,
false
);
configureChart(jfreeChart, getPlot());
CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
JRBarPlot barPlot = (JRBarPlot)getPlot();
//plot.setNoDataMessage("No data to display");
boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
((NumberAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
((NumberAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
categoryRenderer.setShadowVisible(false);
// Handle the axis formating for the category axis
configureAxis(categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
barPlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(),
(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression())
);
// Handle the axis formating for the value axis
configureAxis(categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
barPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression())
);
return jfreeChart;
}
示例7: applyToCategoryItemRenderer
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
* Applies the settings of this theme to the specified renderer.
*
* @param renderer the renderer (<code>null</code> not permitted).
*/
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
ParamChecks.nullNotPermitted(renderer, "renderer");
if (renderer instanceof AbstractRenderer) {
applyToAbstractRenderer((AbstractRenderer) renderer);
}
renderer.setBaseItemLabelFont(this.regularFont);
renderer.setBaseItemLabelPaint(this.itemLabelPaint);
// now we handle some special cases - yes, UGLY code alert!
// BarRenderer
if (renderer instanceof BarRenderer) {
BarRenderer br = (BarRenderer) renderer;
br.setBarPainter(this.barPainter);
br.setShadowVisible(this.shadowVisible);
br.setShadowPaint(this.shadowPaint);
}
// BarRenderer3D
if (renderer instanceof BarRenderer3D) {
BarRenderer3D br3d = (BarRenderer3D) renderer;
br3d.setWallPaint(this.wallPaint);
}
// LineRenderer3D
if (renderer instanceof LineRenderer3D) {
LineRenderer3D lr3d = (LineRenderer3D) renderer;
lr3d.setWallPaint(this.wallPaint);
}
// StatisticalBarRenderer
if (renderer instanceof StatisticalBarRenderer) {
StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
}
// MinMaxCategoryRenderer
if (renderer instanceof MinMaxCategoryRenderer) {
MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
mmcr.setGroupPaint(this.errorIndicatorPaint);
}
}
示例8: createStackedBarChart
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
*
*/
protected JFreeChart createStackedBarChart() throws JRException
{
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createStackedBarChart(
evaluateTextExpression(getChart().getTitleExpression()),
evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
(CategoryDataset)getDataset(),
getPlot().getOrientationValue().getOrientation(),
isShowLegend(),
true,
false
);
configureChart(jfreeChart, getPlot());
CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
JRBarPlot barPlot = (JRBarPlot)getPlot();
//plot.setNoDataMessage("No data to display");
boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
((NumberAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
((NumberAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
categoryRenderer.setShadowVisible(false);
// Handle the axis formating for the category axis
configureAxis(categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
barPlot.getOwnCategoryAxisLineColor(), false,
(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression()));
// Handle the axis formating for the value axis
configureAxis(categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
barPlot.getOwnValueAxisLineColor(), true,
(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));
return jfreeChart;
}
示例9: createGanttChart
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
*
*/
protected JFreeChart createGanttChart() throws JRException
{
//FIXMECHART legend/tooltip/url should come from plot?
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createGanttChart(
evaluateTextExpression(getChart().getTitleExpression()),
evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
(GanttCategoryDataset)getDataset(),
isShowLegend(),
true, //FIXMECHART tooltip: I guess BarPlot is not the best for gantt
false
);
configureChart(jfreeChart, getPlot());
CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
//plot.setNoDataMessage("No data to display");
JRBarPlot barPlot = (JRBarPlot)getPlot();
boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
// Handle the axis formating for the category axis
configureAxis(
categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
barPlot.getOwnCategoryAxisLineColor(), false, null, null
);
((DateAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
((DateAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
// Handle the axis formating for the value axis
configureAxis(
categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
barPlot.getOwnValueAxisLineColor(), true,
(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));
BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
categoryRenderer.setShadowVisible(false);
return jfreeChart;
}
示例10: createGanttChart
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
*
*/
protected JFreeChart createGanttChart() throws JRException
{
//FIXMECHART legend/tooltip/url should come from plot?
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart jfreeChart =
ChartFactory.createGanttChart(
evaluateTextExpression(getChart().getTitleExpression()),
evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
(GanttCategoryDataset)getDataset(),
isShowLegend(),
true, //FIXMECHART tooltip: I guess BarPlot is not the best for gantt
false
);
configureChart(jfreeChart, getPlot());
CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
//plot.setNoDataMessage("No data to display");
JRBarPlot barPlot = (JRBarPlot)getPlot();
boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
//FIXMETHEME these are useless if the theme settings apply after regardless of these; check all
categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
// Handle the axis formating for the category axis
configureAxis(
categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
barPlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(),
(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression())
);
((DateAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
((DateAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
// Handle the axis formating for the value axis
configureAxis(
categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
barPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression())
);
BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
categoryRenderer.setShadowVisible(false);
return jfreeChart;
}