Hi,
I m working with
Java web application with
struts 2 framework. I m having Java open free chart 2 sample source code, which is in
servlet. Can any one help me to provide sample Open free chart 2 example using Struts2.
Or else Can any one tell me how to convert servlet to struts2 action file.
I m tried to convert the code to struts 2 action.
Here is the sample servlet code
private void showPie(HttpServletRequest request,
HttpServletResponse response) throws IOException {
System.out.println("TTTTTTTTTTTTTTEEEEEEEEEEEEEEEEETTTTTTTTTTTTTTTTTTTTT");
Chart chart = new Chart();
Title title = new Title();
title.setText("My name is Title");
title.setStyle("{colour:#DDDDDD;font-size: 15px;}");
Pie pie = new Pie();
pie.setAlpha(0.6);
pie.setAnimate(true);
pie.setBorder(6.0);
pie.setTip("hello");
pie.setValues(new Object[] { 21, 29, 15, 10, 13, 12 });
pie.setColours(new Object[] { "#225599", "#995522", "#3399cc",
"#cc9933", "#551188" });
chart.setPie(pie);
chart.setTitle(title);
chart.setBg_colour("#66DD33");
response.getWriter().write(chart.createChart());
}