userBroswerLine.jsp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. //update-begin--author:zhangjiaqiang Date:20170213 for:修订X坐标轴信息
  14. var xAxisCategories = new Array();
  15. for(var i = 0; i < data[0].data.length; i++){
  16. xAxisCategories[i] = data[0].data[i].name;
  17. }
  18. //update-end--author:zhangjiaqiang Date:20170213 for:修订X坐标轴信息
  19. chart = new Highcharts.Chart({
  20. chart : {
  21. renderTo : 'containerline',
  22. plotBackgroundColor : null,
  23. plotBorderWidth : null,
  24. plotShadow : false
  25. },
  26. title : {
  27. text : "<t:mutiLang langKey="user.browser.analysis"/>"
  28. },
  29. xAxis : {
  30. categories : xAxisCategories
  31. },
  32. tooltip : {
  33. pointFormat : '{series.name}: <b>{point.y}</b>',
  34. percentageDecimals : 1
  35. },
  36. exporting:{
  37. filename:'折线图',
  38. url:'${ctxPath}/logController.do?export'
  39. },
  40. plotOptions : {
  41. pie : {
  42. allowPointSelect : true,
  43. cursor : 'pointer',
  44. showInLegend : true,
  45. dataLabels : {
  46. enabled : true,
  47. color : '#000000',
  48. connectorColor : '#000000',
  49. formatter : function() {
  50. return '<b>' + this.point.name + '</b>: ' + this.y;
  51. }
  52. }
  53. }
  54. },
  55. series : data
  56. });
  57. }
  58. });
  59. });
  60. });
  61. </script>
  62. <div id="containerline" style="width: 80%; height: 80%"></div>