Code: Select all
private JFreeChart drawChart() {
final DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Ticket Chiusi - 65%", new Double(65.0));
dataset.setValue("Ticket Girati - 35%", new Double(35.0));
final JFreeChart chart = ChartFactory.createPieChart3D(
"", // chart title
dataset, // data
true, // include legend
false,
false
);
chart.setBackgroundPaint(new Color(216, 233, 252));
final PiePlot3D plot = (PiePlot3D) chart.getPlot();
plot.setBackgroundPaint(new Color(216, 233, 252));
plot.setOutlineVisible(false);
plot.setLabelLinksVisible(false);
plot.setLabelGenerator(null);
plot.setSectionPaint(dataset.getKey(0), new Color(0, 85, 127));
plot.setSectionPaint(dataset.getKey(1), new Color(204, 221, 230));
return chart;
}
Code: Select all
<div style="width: 250px; margin: auto;">
<logic:notEqual name="reportForm" property="image" value="">
<html:img page="/displayChart.jtck" paramName="reportForm" paramProperty="image" paramId="image"/>
</logic:notEqual>
</div>