Ao executar um exemplo, é gerado um grafico, no entanto há algum problema com a criação da imagem, pois o titulo da imagem aparece como caracter invalido.
Alguem poderia dar um auxílio?
ah, estou usando o Netbeans IDE 6.5.1
obrigado!
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package graficos;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;
/**
*
* @author vtrhode
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws FileNotFoundException, IOException {
// TODO code application logic here
// cria o conjunto de dados
DefaultPieDataset ds = new DefaultPieDataset();
ds.setValue("legenda1", 2.3);
ds.setValue("legenda2", 1.4);
ds.setValue("legenda3", 3.5);
// cria o gráfico
JFreeChart grafico = ChartFactory.createPieChart3D("Meu Grafico", ds, true, false, false);
FileOutputStream fos = new FileOutputStream("grafico.jpg");
ChartUtilities.writeChartAsJPEG(fos, grafico, 550, 400);
}
}
