Dae gurizada!
Preciso customizar as cores do PieChart no JFreeChart, alguem já fez isso ???
Não descobri como fazer…
Abraço!
Dae gurizada!
Preciso customizar as cores do PieChart no JFreeChart, alguem já fez isso ???
Não descobri como fazer…
Abraço!
teata lah…
// create a dataset...
DefaultPieDataset data = new DefaultPieDataset();
data.setValue("One", new Double(43.2));
data.setValue("Two", new Double(10.0));
data.setValue("Three", new Double(27.5));
data.setValue("Four", new Double(17.5));
data.setValue("Five", new Double(11.0));
data.setValue("Six", new Double(19.4));
data.setValue("Seven", new Double(19.4));
data.setValue("Eight", new Double(19.4));
data.setValue("Nine", new Double(9.4));
data.setValue("Ten", new Double(19.4));
data.setValue("Eleven", new Double(9.4));
data.setValue("Twelve", new Double(9.4));
data.setValue("Thirteen", new Double(9.4));
data.setValue("Fourteen", new Double(9.4));
// create the chart...
JFreeChart chart = ChartFactory.createPieChart(
"Pie Chart Demo 4", // chart title
data, // data
true, // include legend
true,
false
);
// set the background color for the chart...
chart.setBackgroundPaint(Color.yellow);
PiePlot plot = (PiePlot) chart.getPlot();
plot.setSectionLabelType(PiePlot.NAME_AND_PERCENT_LABELS);
plot.setNoDataMessage("No data available");
plot.setToolTipGenerator(new StandardPieToolTipGenerator());
plot.setPaint(0, new Color(0xCC, 0xCC, 0xFF));
plot.setPaint(1, new Color(0xFF, 0xCC, 0xCC));
plot.setPaint(2, new Color(0xCC, 0xFF, 0xCC));
plot.setPaint(3, new Color(0xFF, 0x99, 0x99));
plot.setPaint(4, new Color(0x99, 0xFF, 0x99));
plot.setPaint(5, new Color(0x99, 0x99, 0xFF));
Mas aaaaaaaahhhhhhhhhh !!!
Valeu meu bruxo!!
Abraço