Pessoal, estou gerando um gráfico em JSP:
[code]DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(10, “10”, “Teste2”);
dataset.addValue(120, “120”, “Teste5”);
JFreeChart chart = ChartFactory.createBarChart3D(“Sua Pontuação”, “”, “Pontos (%)”, dataset, PlotOrientation.HORIZONTAL, true, false, false);
CategoryPlot plot = chart.getCategoryPlot();
plot.getRangeAxis().setRange(0, 500);
BarRenderer renderer = (BarRenderer)plot.getRenderer();
renderer.setSeriesPaint(0, Color.BLUE);
try {
response.setContentType("image/png");
OutputStream os = response.getOutputStream();
int height = dataset.getColumnCount()*45 + 65;
ChartUtilities.writeChartAsPNG(os, chart, 500, height);
os.close();
} catch (IOException e) {
System.err.println("Problem occurred creating chart.");
}[/code]
ele está em uma página xxxxx.jsp que tem seus htmls lá funcionando e tal. Quando eu chamo esse código dentro dos <% %> ele me redireciona para a mesma página só que sem nenhum html, só o grafico ! Alguem sabe como inserir esse gráfico dentro da mesma página ?
Eu estava testando eu botar o codigo em outra pagina jsp também, e nessa xxxxx.jsp chamar essa outra pag, mas nao deu certo
Alguem tem uma solução ?
Desde já agradeço ! Obrigado !