userBroswerPie.jsp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <c:set var="ctxPath" value="${pageContext.request.contextPath}" />
  4. <script type="text/javascript">
  5. $(function() {
  6. $(document).ready(function() {
  7. var chart;
  8. $.ajax({
  9. type : "POST",
  10. url : "logController.do?getBroswerBar&reportType=${reportType}",
  11. success : function(jsondata) {
  12. data = eval(jsondata);
  13. chart = new Highcharts.Chart({
  14. chart : {
  15. renderTo : 'containerPie',
  16. plotBackgroundColor : null,
  17. plotBorderWidth : null,
  18. plotShadow : false
  19. },
  20. title : {
  21. text : "<t:mutiLang langKey="user.browser.analysis"/>"
  22. },
  23. xAxis : {
  24. categories : [ 'IE9', 'MSIE 7.0', 'MSIE 8.0', 'MSIE 7.0', 'Firefox', 'Chrome' ]
  25. },
  26. tooltip : {
  27. shadow: false,
  28. percentageDecimals : 1,
  29. formatter: function() {
  30. return '<b>'+this.point.name + '</b>:' + Highcharts.numberFormat(this.percentage, 1) +'%';
  31. }
  32. },
  33. exporting:{
  34. filename:'pie',
  35. url:'${ctxPath}/logController.do?export'
  36. },
  37. plotOptions : {
  38. pie : {
  39. allowPointSelect : true,
  40. cursor : 'pointer',
  41. showInLegend : true,
  42. dataLabels : {
  43. enabled : true,
  44. color : '#000000',
  45. connectorColor : '#000000',
  46. formatter : function() {
  47. return '<b>' + this.point.name + '</b>: ' + Highcharts.numberFormat(this.percentage, 1)+"%";
  48. }
  49. }
  50. }
  51. },
  52. series : data
  53. });
  54. }
  55. });
  56. });
  57. });
  58. </script>
  59. <div id="containerPie" style="width: 80%; height: 80%"></div>