i have generated chart and imagemap using jfreechart in gwt servlet...but i
am getting only chart...i want clickable imagemap...i guess i need to
return chart and image map sepratly..how can i do that?? please help
me..here is my code..I am only getting Chart..I want clickable image
map..please help..
public class Clickablebar extends HttpServlet
{
public Clickablebar() {
super();
}
protected void doGet(HttpServletRequest request,HttpServletResponse
response)
throws ServletException, IOException
{
Clickablebar.doGe(request, response);
}
public static String doGe(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
PrintWriter out = new PrintWriter(response.getOutputStream());
double[][] data = new double[][] {
{56.0, -12.0, 34.0, 76.0, 56.0, 100.0, 67.0, 45.0},
{37.0, 45.0, 67.0, 25.0, 34.0, 34.0, 100.0, 53.0},
{43.0, 54.0, 34.0, 34.0, 87.0, 64.0, 73.0, 12.0}
};
CategoryDataset dataset = DatasetUtilities.createCategoryDataset(
"Series ", "Type ", data
);
JFreeChart chart = null;
boolean drilldown = true;
if (drilldown) {
CategoryAxis3D categoryAxis = new CategoryAxis3D("Category");
ValueAxis valueAxis = new NumberAxis3D("Value");
BarRenderer3D renderer = new BarRenderer3D();
renderer.setToolTipGenerator(
new StandardCategoryToolTipGenerator());
renderer.setItemURLGenerator(new StandardCategoryURLGenerator(
"barchart101.html"));
CategoryPlot plot = new CategoryPlot(dataset, categoryAxis,
valueAxis, renderer);
plot.setOrientation(PlotOrientation.VERTICAL);
chart = new JFreeChart("Bar Chart",
JFreeChart.DEFAULT_TITLE_FONT,
plot, true);
}
else {
chart = ChartFactory.createBarChart3D(
"Bar Chart", // chart title
"Category", // domain axis label
"Value", // range axis label
dataset, // data
PlotOrientation.VERTICAL,
true, // include legend
true,
false
);
}
chart.setBackgroundPaint(java.awt.Color.white);
// save it to an image
ChartRenderingInfo info = new ChartRenderingInfo(
new StandardEntityCollection());
ChartUtilities.writeChartAsPNG(out1, chart, 600, 400, info);
ImageMapUtilities.writeImageMap(out, "chart", info);
String str= ChartUtilities.getImageMap("chart",info);
out.flush();
return str ;
}
}
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.