namespace Ujihara.Demo { using org.jfree.chart; using org.jfree.chart.block; using org.jfree.chart.labels; using org.jfree.chart.plot; using org.jfree.chart.urls; using org.jfree.data.general; using org.jfree.ui; using System.Drawing; using System.Reflection; using System.IO; using System.Drawing.Drawing2D; public class PieChart3DDemo2 : ChartCreator { public override JFreeChart CreateChart() { PieDataset dataset = DatasetCreator.createPieDataset(); PiePlot3D plot = new PiePlot3D(dataset); plot.setLabelBackgroundPaint(Color.Cyan); plot.setBackgroundPaint(Color.White); { Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(this.GetType(), "Web.png"); Image image = Image.FromStream(stream); Brush brush = new System.Drawing.TextureBrush(image); plot.setSectionPaint(0, brush); } plot.setSectionPaint(1, Color.FromArgb(255, 255, 0)); plot.setSectionPaint(2, new LinearGradientBrush(new Point(200, 200), new Point(400, 400), Color.Blue, Color.Red)); plot.setSectionPaint(3, Color.FromArgb(127, 0, 255, 255)); plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0}")); plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{1}")); JFreeChart chart = new JFreeChart(Name, JFreeChart.DEFAULT_TITLE_FONT, plot, true); chart.setBackgroundPaint(Color.White); chart.getLegend().setPosition(RectangleEdge.TOP); chart.getLegend().setBorder(BlockBorder.NONE); return chart; } } }