portal.jsp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
  3. <%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=GBK" />
  7. <title>Charts</title>
  8. <link rel="stylesheet" type="text/css" href="/share/js/ext/resources/css/ext-all.css"/>
  9. <!-- GC -->
  10. <!-- LIBS -->
  11. <script type="text/javascript" src="js/ext/adapter/ext/ext-base.js"></script>
  12. <!-- ENDLIBS -->
  13. <script type="text/javascript" src="js/ext/ext-all.js"></script>
  14. <script type="text/javascript">
  15. Ext.chart.Chart.CHART_URL = '/share/js/ext/resources/charts.swf';
  16. Ext.onReady(function(){
  17. var store = new Ext.data.JsonStore({
  18. root:'data',
  19. fields:['name', 'visits', 'views'],
  20. url:"/ynet/LogUserChart.do"
  21. });
  22. store.load();
  23. var panel = new Ext.Panel({
  24. id:'main-panel',
  25. baseCls:'x-plain',
  26. renderTo: Ext.getBody(),
  27. margins:'0 5 5 0',
  28. layout:'column',
  29. // applied to child components
  30. items:[{
  31. columnWidth:.5,
  32. baseCls:'x-plain',
  33. bodyStyle:'padding:5px 0 5px 5px',
  34. items:[{
  35. title:'欢迎',
  36. html:'<li>您好,${oasession.userName},欢迎回来!</li>'
  37. },{
  38. title:'帮助',
  39. html:'<li>您好,${oasession.userName},欢迎回来!</li>'
  40. },{
  41. title:'关于',
  42. html:'<li>此软件版权为快船所有</li>'
  43. }]
  44. },{
  45. baseCls:'x-plain',
  46. bodyStyle:'padding:5px',
  47. columnWidth:.5,
  48. items:[{
  49. title:'用户访问图表',
  50. html:'<div id=container1></div>'
  51. },
  52. {
  53. title:'按月访问图表',
  54. html:'<div id=container2></div>'
  55. }]
  56. }]
  57. });
  58. var panel1=new Ext.Panel({
  59. width:400,
  60. height:200,
  61. renderTo: 'container1',
  62. items: {
  63. store: store,
  64. xtype: 'piechart',
  65. dataField: 'visits',
  66. categoryField: 'name',
  67. //extra styles get applied to the chart defaults
  68. extraStyle:
  69. {
  70. legend:
  71. {
  72. display: 'bottom',
  73. padding: 5,
  74. font:
  75. {
  76. family: 'Tahoma',
  77. size: 13
  78. }
  79. }
  80. }
  81. }
  82. });
  83. // extra extra simple
  84. var panel2=new Ext.Panel({
  85. renderTo: 'container2',
  86. width:400,
  87. height:300,
  88. layout:'fit',
  89. items: {
  90. xtype: 'linechart',
  91. store: store,
  92. xField: 'name',
  93. yField: 'visits',
  94. listeners: {
  95. itemclick: function(o){
  96. var rec = store.getAt(o.index);
  97. Ext.example.msg('Item Selected', 'You chose {0}.', rec.get('name'));
  98. }
  99. }
  100. }
  101. });
  102. });
  103. </script>
  104. </head>
  105. <body>
  106. </body>
  107. </html>