java setforeground_Java CategoryPlot.setForegroundAlpha方法代码示例

import org.jfree.chart.plot.CategoryPlot; //导入方法依赖的package包/类

/**

* Creates a bar chart with a 3D effect. The chart object returned by this

* method uses a {@link CategoryPlot} instance as the plot, with a

* {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as

* the range axis, and a {@link BarRenderer3D} as the renderer.

*

* @param title the chart title (null permitted).

* @param categoryAxisLabel the label for the category axis

* (null permitted).

* @param valueAxisLabel the label for the value axis (null

* permitted).

* @param dataset the dataset for the chart (null permitted).

* @param orientation the plot orientation (horizontal or vertical)

* (null not permitted).

* @param legend a flag specifying whether or not a legend is required.

* @param tooltips configure chart to generate tool tips?

* @param urls configure chart to generate URLs?

*

* @return A bar chart with a 3D effect.

*/

public static JFreeChart createBarChart3D(String title,

String categoryAxisLabel,

String valueAxisLabel,

CategoryDataset dataset,

PlotOrientation orientation,

boolean legend,

boolean tooltips,

boolean urls) {

if (orientation == null) {

throw new IllegalArgumentException("Null 'orientation' argument.");

}

CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);

ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

BarRenderer3D renderer = new BarRenderer3D();

if (tooltips) {

renderer.setBaseToolTipGenerator(

new StandardCategoryToolTipGenerator());

}

if (urls) {

renderer.setBaseItemURLGenerator(

new StandardCategoryURLGenerator());

}

CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,

renderer);

plot.setOrientation(orientation);

if (orientation == PlotOrientation.HORIZONTAL) {

// change rendering order to ensure that bar overlapping is the

// right way around

plot.setRowRenderingOrder(SortOrder.DESCENDING);

plot.setColumnRenderingOrder(SortOrder.DESCENDING);

}

plot.setForegroundAlpha(0.75f);

JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,

plot, legend);

return chart;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值