JFreeChart não mostra os valores na legenda

2 respostas
R

Pessoal… o meu gráfico não está mostrando os valores nas porções de pizza.
vejam o codigo:

DefaultPieDataset dataset = new DefaultPieDataset();

	dataset.setValue("Com Governo", new Double(votosComGoverno));
	dataset.setValue( "Divergentes", new Double(votoDivergentes));
	
	JFreeChart chart = ChartFactory.createPieChart3D("Expediente" , dataset, true, true, false);
		
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");
    plot.setIgnoreZeroValues(true);

 BufferedImage chartImage = chart.createBufferedImage(350, 200, info);

a saída fica igual a imagem anexada.

2 Respostas

matheuscechito
tente algo assim...é pra aparecer porcentagem...
t+

tente algo assim…é pra aparecer porcentagem…
t+

R

Perfeito amigo… repliquei a idéia para a legenda tb e deu certo.
obrigado.

Criado 24 de abril de 2007
Ultima resposta 24 de abr. de 2007
Respostas 2
Participantes 2