本文整理汇总了Java中org.jfree.chart.plot.PiePlot.setBackgroundPaint方法的典型用法代码示例。如果您正苦于以下问题:Java PiePlot.setBackgroundPaint方法的具体用法?Java PiePlot.setBackgroundPaint怎么用?Java PiePlot.setBackgroundPaint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.plot.PiePlot
的用法示例。
在下文中一共展示了PiePlot.setBackgroundPaint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generatePieChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
public static JFreeChart generatePieChart()
{
DefaultPieDataset dataSet = new DefaultPieDataset();
dataSet.setValue("China", 30);
dataSet.setValue("India", 30);
dataSet.setValue("United States", 40);
JFreeChart chart = ChartFactory.createPieChart("", dataSet, false, true, false);
PiePlot piePlot = (PiePlot) chart.getPlot();
piePlot.setBackgroundPaint(Color.WHITE); // set background color white
piePlot.setOutlineVisible(false); // remove background border
piePlot.setLabelGenerator(null); // remove pie section labels
piePlot.setSectionPaint("China", Color.GRAY);
piePlot.setSectionPaint("India", Color.GREEN);
piePlot.setSectionPaint("United States", Color.BLUE);
piePlot.setShadowPaint(Color.WHITE);
return chart;
}
示例2: createPieChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
private static JFreeChart createPieChart(PieDataset piedataset, GraphDataItem item) {
JFreeChart jfreechart = ChartFactory.createPieChart(item.getTitle(), piedataset, true, true, false);
Font font = new Font("宋体", Font.PLAIN, 13);
jfreechart.getTitle().setFont(font);
jfreechart.getLegend().setItemFont(font);
PiePlot pieplot = (PiePlot) jfreechart.getPlot();
pieplot.setBackgroundPaint(ChartColor.WHITE);
pieplot.setLabelFont(font);
pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator(("{0}: ({2})"),
NumberFormat.getNumberInstance(), new DecimalFormat("0.00%")));
pieplot.setLabelBackgroundPaint(new Color(220, 220, 220));
pieplot.setSimpleLabels(true);
pieplot.setInteriorGap(0.0D);
int index = 0;
for (Object name : item.getDatas().keySet()) {
pieplot.setSectionPaint((String) name, COLORS[index % COLORS.length]);
index++;
}
return jfreechart;
}
示例3: ChartWidget
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
public ChartWidget() {
rightLabel = new JLabel();
Font rightFont = new Font("Verdana", Font.PLAIN, 12);
rightLabel.setHorizontalAlignment(JLabel.LEFT);
rightLabel.setVerticalAlignment(JLabel.TOP);
rightLabel.setFont(rightFont);
this.add(rightLabel);
myColoredPieChart = new DefaultPieDataset();
myColoredChart = ChartFactory.createPieChart3D("", myColoredPieChart,
false, false, false);
myColoredChart.setBorderVisible(false);
myColoredChart.setBackgroundPaint(new Color(0, 0, 0, 0)); // transparent
// black
PiePlot configurator = (PiePlot) myColoredChart.getPlot();
configurator.setBackgroundPaint(new Color(0, 0, 0, 0));
configurator.setLabelGenerator(null);
configurator.setOutlineVisible(false);
ChartPanel chartPanel = new ChartPanel(myColoredChart, 150, 150, 150,
150, 250, 250, true, false, false, false, false, false);
this.add(chartPanel);
}
示例4: makePlot
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
@Override
protected Plot makePlot(final JFreeChartBuilder.PlotParameters parameters) {
final KeyedValuesDataset tmpDataset = this.getDataset();
final PiePlot retVal = new PiePlot(tmpDataset);
retVal.setShadowXOffset(0);
retVal.setShadowYOffset(0);
retVal.setBackgroundPaint(parameters.getBackground());
retVal.setOutlinePaint(parameters.getOutline());
retVal.setLabelGenerator(new StandardPieSectionLabelGenerator());
if (this.isTooltips()) {
retVal.setToolTipGenerator(new StandardPieToolTipGenerator());
}
if (this.isUrls()) {
retVal.setURLGenerator(new StandardPieURLGenerator());
}
for (final Entry<Comparable<?>, Paint> tmpEntry : this.getColourSet()) {
retVal.setSectionPaint(tmpEntry.getKey(), tmpEntry.getValue());
}
return retVal;
}
示例5: createChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
protected JFreeChart createChart(PieDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createPieChart(
chartTitle, // chart title
dataset, // dataset
!legendPanelOn, // include legend
true,
false
);
// set the background color for the chart...
chart.setBackgroundPaint(new Color(222, 222, 255));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(Color.white);
plot.setCircular(true);
for (int i=0; i<pulloutFlag.length; i++){
//System.out.println("\""+pulloutFlag[i]+"\"");
if (isPullout(i)){
Comparable key = dataset.getKey(i);
plot.setExplodePercent(key, 0.30);
}
}
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} = {2}",
NumberFormat.getNumberInstance(),
NumberFormat.getPercentInstance()));
plot.setNoDataMessage("No data available");
if(rotateOn){
Rotator rotator = new Rotator(plot);
rotator.start();
}
setCategorySummary(dataset);
return chart;
}
示例6: getMultiplePieChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
private JFreeChart getMultiplePieChart( BaseChart chart, CategoryDataset[] dataSets )
{
JFreeChart multiplePieChart = ChartFactory.createMultiplePieChart( chart.getName(), dataSets[0], TableOrder.BY_ROW,
!chart.isHideLegend(), false, false );
setBasicConfig( multiplePieChart, chart );
if ( multiplePieChart.getLegend() != null )
{
multiplePieChart.getLegend().setItemFont( SUB_TITLE_FONT );
}
MultiplePiePlot multiplePiePlot = (MultiplePiePlot) multiplePieChart.getPlot();
JFreeChart pieChart = multiplePiePlot.getPieChart();
pieChart.setBackgroundPaint( COLOR_TRANSPARENT );
pieChart.getTitle().setFont( SUB_TITLE_FONT );
PiePlot piePlot = (PiePlot) pieChart.getPlot();
piePlot.setBackgroundPaint( COLOR_TRANSPARENT );
piePlot.setOutlinePaint( COLOR_TRANSPARENT );
piePlot.setLabelFont( LABEL_FONT );
piePlot.setLabelGenerator( new StandardPieSectionLabelGenerator( "{2}" ) );
piePlot.setSimpleLabels( true );
piePlot.setIgnoreZeroValues( true );
piePlot.setIgnoreNullValues( true );
piePlot.setShadowXOffset( 0d );
piePlot.setShadowYOffset( 0d );
for ( int i = 0; i < dataSets[0].getColumnCount(); i++ )
{
piePlot.setSectionPaint( dataSets[0].getColumnKey( i ), COLORS[(i % COLORS.length)] );
}
return multiplePieChart;
}
示例7: stylePiePlot
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* Style the plot of a pie chart.
*/
public static void stylePiePlot(PiePlot plot) {
plot.setLabelFont(EHtmlPresentationFont.SANS_CONDENSED.getFont());
plot.setSectionOutlinesVisible(false);
plot.setLabelGap(0.02);
plot.setBackgroundPaint(Color.WHITE);
}
示例8: erstelleKuchenDiagramm
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* Erstellt ein Kuchendiagramm aus den Parametern.
*
* @param dataset
* Datenset
* @param titel
* Titel
* @return {@link JFreeChart}
*/
private JFreeChart erstelleKuchenDiagramm(PieDataset dataset, String titel) {
JFreeChart chart = ChartFactory.createPieChart3D(titel, dataset, true,
true, false);
TextTitle t = chart.getTitle();
t.setHorizontalAlignment(HorizontalAlignment.CENTER);
t.setFont(new Font("Arial", Font.CENTER_BASELINE, 26));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(null);
plot.setInteriorGap(0.04);
plot.setOutlineVisible(false);
for (Partei partei : parteienListe) {
if (partei.getFarbe() != null) {
plot.setSectionPaint(
partei.getName(),
createGradientPaint(partei.getFarbe(),
partei.getFarbe()));
}
}
plot.setBaseSectionOutlinePaint(Color.GRAY);
plot.setLabelFont(new Font("Arial", Font.BOLD, 15));
plot.setLabelLinkPaint(Color.black);
plot.setLabelPaint(Color.black);
plot.setLabelBackgroundPaint(null);
return chart;
}
示例9: renderChartToFile
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
private Image renderChartToFile(TotalPaymentSummaryReportResponse response, File chartFile) throws IOException,
BadElementException, MalformedURLException {
// For generating pie chart for total payments(example for total deposits) perform following:
// Create the dataset
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Pre 10/82 Deposit", response.getTotalDepositsPre1082());
dataset.setValue("Pre 10/82 Redeposit", response.getTotalRedepositsPre1082());
dataset.setValue("CSRS: Post 9/82 Deposit", response.getCsrsDepositsPost982());
dataset.setValue("FERS Postal", response.getFersPostalDepositsPost982());
dataset.setValue("FERS Non Postal", response.getFersNonPostalDepositsPost982());
dataset.setValue("Post 9/82 Deposit", response.getTotalDepositsPost982());
dataset.setValue("Post 9/82 Redeposit", response.getTotalRedepositsPost982());
// Set following data
// Create the chart
JFreeChart chart = ChartFactory.createPieChart("Total Payments", dataset, true, true, false);
PiePlot plot = (PiePlot) chart.getPlot();
plot.setLabelFont(new Font("Helvetica", 0, 10));
plot.setBackgroundPaint(Color.white);
plot.setIgnoreZeroValues(false);
plot.setOutlineVisible(false);
chart.getTitle().setFont(new Font("Helvetica", 1, 14));
LegendTitle legend = chart.getLegend();
legend.setItemFont(new Font("Helvetica", 0, 10));
legend.setPosition(RectangleEdge.RIGHT);
ChartUtilities.saveChartAsPNG(chartFile, chart, chartWidth, chartHeight);
Image image = Image.getInstance(chartFile.getAbsolutePath());
return image;
}
开发者ID:NASA-Tournament-Lab,项目名称:CoECI-OPM-Service-Credit-Redeposit-Deposit-Application,代码行数:35,代码来源:TotalPaymentSummaryReportService.java
示例10: createPieChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
private JFreeChart createPieChart() throws QueryException {
pieDataset = new DefaultPieDataset();
String chartTitle = replaceParameters(chart.getTitle().getTitle());
chartTitle = StringUtil.getI18nString(chartTitle, I18nUtil.getLanguageByName(chart, language));
JFreeChart jfreechart = ChartFactory.createPieChart(
chartTitle,
pieDataset,
true,
true,
false);
// hide border
jfreechart.setBorderVisible(false);
// title
setTitle(jfreechart);
PiePlot plot = (PiePlot)jfreechart.getPlot();
plot.setForegroundAlpha(transparency);
// a start angle used to create similarities between flash chart and this jfreechart
plot.setStartAngle(330);
// legend label will contain the text and the value
plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0} = {1}"));
// no shadow
plot.setShadowXOffset(0);
plot.setShadowYOffset(0);
DecimalFormat decimalformat;
DecimalFormat percentageFormat;
if (chart.getYTooltipPattern() == null) {
decimalformat = new DecimalFormat("#");
percentageFormat = new DecimalFormat("0.00%");
} else {
decimalformat = new DecimalFormat(chart.getYTooltipPattern());
percentageFormat = decimalformat;
}
boolean showValues = (chart.getShowYValuesOnChart() == null) ? false : chart.getShowYValuesOnChart();
if (showValues) {
// label will contain also the percentage formatted with two decimals
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} ({2})", decimalformat, percentageFormat));
}
// chart background
plot.setBackgroundPaint(chart.getBackground());
createChart(null, new Object[1]);
// after chart creation we can set slices colors
List <Comparable> keys = pieDataset.getKeys();
List<Color> colors = chart.getForegrounds();
for (int i = 0, size = colors.size(); i < keys.size(); i++) {
plot.setSectionPaint(keys.get(i), colors.get(i % size));
plot.setLabelFont(chart.getFont());
}
return jfreechart;
}
示例11: createChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the dataset.
*
* @return A chart.
*/
private static JFreeChart createChart(PieDataset dataset) {
JFreeChart chart = ChartFactory.createPieChart(
"Smart Phones Manufactured / Q3 2011", dataset);
// set a custom background for the chart
chart.setBackgroundPaint(new GradientPaint(new Point(0, 0),
new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));
// customise the title position and font
TextTitle t = chart.getTitle();
t.setHorizontalAlignment(HorizontalAlignment.LEFT);
t.setPaint(new Color(240, 240, 240));
t.setFont(new Font("Arial", Font.BOLD, 26));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(null);
plot.setInteriorGap(0.04);
plot.setOutlineVisible(false);
// use gradients and white borders for the section colours
plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE));
plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED));
plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN));
plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW));
plot.setDefaultSectionOutlinePaint(Color.WHITE);
plot.setSectionOutlinesVisible(true);
plot.setDefaultSectionOutlineStroke(new BasicStroke(2.0f));
// customise the section label appearance
plot.setLabelFont(new Font("Courier New", Font.BOLD, 20));
plot.setLabelLinkPaint(Color.WHITE);
plot.setLabelLinkStroke(new BasicStroke(2.0f));
plot.setLabelOutlineStroke(null);
plot.setLabelPaint(Color.WHITE);
plot.setLabelBackgroundPaint(null);
// add a subtitle giving the data source
TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523",
new Font("Courier New", Font.PLAIN, 12));
source.setPaint(Color.WHITE);
source.setPosition(RectangleEdge.BOTTOM);
source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
chart.addSubtitle(source);
return chart;
}
示例12: createChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the dataset.
*
* @return A chart.
*/
private static JFreeChart createChart(PieDataset dataset) {
JFreeChart chart = ChartFactory.createPieChart(
"Smart Phones Manufactured / Q3 2011", // chart title
dataset, // data
false, // no legend
true, // tooltips
false // no URL generation
);
// set a custom background for the chart
chart.setBackgroundPaint(new GradientPaint(new Point(0, 0),
new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));
// customise the title position and font
TextTitle t = chart.getTitle();
t.setHorizontalAlignment(HorizontalAlignment.LEFT);
t.setPaint(new Color(240, 240, 240));
t.setFont(new Font("Arial", Font.BOLD, 26));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(null);
plot.setInteriorGap(0.04);
// plot.setOutlineVisible(false);
// use gradients and white borders for the section colours
plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE));
plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED));
plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN));
plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW));
plot.setBaseSectionOutlinePaint(Color.WHITE);
plot.setSectionOutlinesVisible(true);
plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f));
// customise the section label appearance
plot.setLabelFont(new Font("Courier New", Font.BOLD, 20));
plot.setLabelLinkPaint(Color.WHITE);
plot.setLabelLinkStroke(new BasicStroke(2.0f));
plot.setLabelOutlineStroke(null);
plot.setLabelPaint(Color.WHITE);
plot.setLabelBackgroundPaint(null);
// add a subtitle giving the data source
TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523",
new Font("Courier New", Font.PLAIN, 12));
source.setPaint(Color.WHITE);
source.setPosition(RectangleEdge.BOTTOM);
source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
chart.addSubtitle(source);
return chart;
}
示例13: createChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the dataset.
*
* @return A chart.
*/
private static JFreeChart createChart(PieDataset dataset) {
JFreeChart chart = ChartFactory.createPieChart(
"Smart Phones Manufactured / Q3 2011", // chart title
dataset, // data
false, // no legend
true, // tooltips
false // no URL generation
);
// set a custom background for the chart
chart.setBackgroundPaint(new GradientPaint(new Point(0, 0),
new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));
// customise the title position and font
TextTitle t = chart.getTitle();
t.setHorizontalAlignment(HorizontalAlignment.LEFT);
t.setPaint(new Color(240, 240, 240));
t.setFont(new Font("Arial", Font.BOLD, 26));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(null);
plot.setInteriorGap(0.04);
plot.setOutlineVisible(false);
// use gradients and white borders for the section colours
plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE));
plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED));
plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN));
plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW));
plot.setBaseSectionOutlinePaint(Color.WHITE);
plot.setSectionOutlinesVisible(true);
plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f));
// customise the section label appearance
plot.setLabelFont(new Font("Courier New", Font.BOLD, 20));
plot.setLabelLinkPaint(Color.WHITE);
plot.setLabelLinkStroke(new BasicStroke(2.0f));
plot.setLabelOutlineStroke(null);
plot.setLabelPaint(Color.WHITE);
plot.setLabelBackgroundPaint(null);
// add a subtitle giving the data source
TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523",
new Font("Courier New", Font.PLAIN, 12));
source.setPaint(Color.WHITE);
source.setPosition(RectangleEdge.BOTTOM);
source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
chart.addSubtitle(source);
return chart;
}
示例14: renderChartInfo
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
private void renderChartInfo() {
Hashtable<Object, Marker> marks = new Hashtable<>();
DefaultPieDataset dataset = buildDataset(marks);
JFreeChart chart = ChartFactory.createPieChart(
null, // chart title
dataset, // data
true, // include legend
true,
false);
chart.setBackgroundPaint(null);
//chart.setBorderStroke(null);
chart.setBorderVisible(false);
final PiePlot plot = (PiePlot) chart.getPlot();
// plot.setBackgroundPaint(null);
// plot.setShadowPaint(null);
Enumeration<Object> markKeys = marks.keys();
while (markKeys.hasMoreElements()) {
if (iCurrentView == ID_ALLY_CHART) {
Ally a = (Ally) markKeys.nextElement();
plot.setSectionPaint(a.getTag(), marks.get(a).getMarkerColor());
} else {
Tribe t = (Tribe) markKeys.nextElement();
plot.setSectionPaint(t.getName(), marks.get(t).getMarkerColor());
}
}
//plot.setCircular(true);
// plot.setMaximumLabelWidth(30.0);
/*
* plot.setLabelGenerator(new StandardPieSectionLabelGenerator( "{0} = {2}", NumberFormat.getNumberInstance(),
* NumberFormat.getPercentInstance()));
*/
// chart.getLegend().setVerticalAlignment(VerticalAlignment.CENTER);
// chart.getLegend().setPosition(RectangleEdge.RIGHT);
// plot.setMaximumLabelWidth(20.0);
plot.setLabelGenerator(null);
plot.setBackgroundPaint(Constants.DS_BACK);
/*
* plot.setInteriorGap(0.0); plot.setLabelGap(0.0);
*/
plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator(
"{0} = {2}", NumberFormat.getNumberInstance(), NumberFormat.getPercentInstance()));
/*
* plot.getL plot.setLabelFont(g2d.getFont().deriveFont(10.0f));
*/
//plot.setLabelGenerator(null);
//plot.setMaximumLabelWidth(30.0);
//plot.getLabelDistributor().distributeLabels(10.0, 20.0);
//chart.draw(g2d, new Rectangle2D.Float(20, 20, 100, 100));
// g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
plot.setOutlineVisible(false);
mChartImage = chart.createBufferedImage(getWidth(), getHeight());
//chart.draw(g2d, new Rectangle2D.Float(50, 50, 400, 400));
//g2d.drawImage(bi, 30, 30, null);
// g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
//bi = chart.createBufferedImage(240, 240);
// g2d.drawImage(bi, 30, 30, null);
}
示例15: generatePieChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
private byte[] generatePieChart(
String siteId, PieDataset dataset, int width, int height,
boolean render3d, float transparency,
boolean smallFontInDomainAxis) {
JFreeChart chart = null;
if(render3d)
chart = ChartFactory.createPieChart3D(null, dataset, false, false, false);
else
chart = ChartFactory.createPieChart(null, dataset, false, false, false);
PiePlot plot = (PiePlot) chart.getPlot();
// set start angle (135 or 150 deg so minor data has more space on the left)
plot.setStartAngle(150D);
// set transparency
plot.setForegroundAlpha(transparency);
// set background
chart.setBackgroundPaint(parseColor(M_sm.getChartBackgroundColor()));
plot.setBackgroundPaint(parseColor(M_sm.getChartBackgroundColor()));
// fix border offset
chart.setPadding(new RectangleInsets(5,5,5,5));
plot.setInsets(new RectangleInsets(1,1,1,1));
// set chart border
plot.setOutlinePaint(null);
chart.setBorderVisible(true);
chart.setBorderPaint(parseColor("#cccccc"));
// set antialias
chart.setAntiAlias(true);
BufferedImage img = chart.createBufferedImage(width, height);
final ByteArrayOutputStream out = new ByteArrayOutputStream();
try{
ImageIO.write(img, "png", out);
}catch(IOException e){
log.warn("Error occurred while generating SiteStats chart image data", e);
}
return out.toByteArray();
}