Advertisement
Guest User

Untitled

a guest
Oct 26th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <s:submit value="Show Chart" align="center" action="displayChartAction" />
  2.  
  3. <action name="displayChartAction"
  4. class="com.tutorialspoint.struts2.jFreeChartAction"
  5. method="execute">
  6. <result name="success" type="chart">
  7. <param name="value">chart</param>
  8. <param name="type">jpeg</param>
  9. <param name="width">600</param>
  10. <param name="height">400</param>
  11. </result>
  12. </action>
  13.  
  14. public class JfreeChartAction extends ActionSupport {
  15.  
  16. public String execute() throws Exception {
  17.  
  18. //some code to populate dataSet
  19.  
  20.  
  21. chart = ChartFactory.createBarChart(
  22. "Bar Chart", //Chart title
  23. "", //Domain axis label
  24. "TRANSACTIONS", //Range axis label
  25. dataSet, //Chart Data
  26. PlotOrientation.VERTICAL, // orientation
  27. true, // include legend?
  28. true, // include tooltips?
  29. false // include URLs?
  30. );
  31. chart.setBorderVisible(true);
  32. System.out.println("Execute Ends");
  33.  
  34. return SUCCESS;
  35.  
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement