| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
- <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
- <%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=GBK" />
- <title>Charts</title>
- <link rel="stylesheet" type="text/css" href="/share/js/ext/resources/css/ext-all.css"/>
- <!-- GC -->
- <!-- LIBS -->
- <script type="text/javascript" src="js/ext/adapter/ext/ext-base.js"></script>
- <!-- ENDLIBS -->
- <script type="text/javascript" src="js/ext/ext-all.js"></script>
- <script type="text/javascript">
- Ext.chart.Chart.CHART_URL = '/share/js/ext/resources/charts.swf';
- Ext.onReady(function(){
- var store = new Ext.data.JsonStore({
- root:'data',
- fields:['name', 'visits', 'views'],
- url:"/ynet/LogUserChart.do"
- });
- store.load();
-
- var panel = new Ext.Panel({
- id:'main-panel',
- baseCls:'x-plain',
- renderTo: Ext.getBody(),
- margins:'0 5 5 0',
- layout:'column',
- // applied to child components
- items:[{
- columnWidth:.5,
- baseCls:'x-plain',
- bodyStyle:'padding:5px 0 5px 5px',
- items:[{
- title:'欢迎',
- html:'<li>您好,${oasession.userName},欢迎回来!</li>'
- },{
- title:'帮助',
- html:'<li>您好,${oasession.userName},欢迎回来!</li>'
- },{
- title:'关于',
- html:'<li>此软件版权为快船所有</li>'
- }]
- },{
- baseCls:'x-plain',
- bodyStyle:'padding:5px',
- columnWidth:.5,
- items:[{
- title:'用户访问图表',
- html:'<div id=container1></div>'
- },
- {
- title:'按月访问图表',
- html:'<div id=container2></div>'
- }]
- }]
- });
-
- var panel1=new Ext.Panel({
- width:400,
- height:200,
- renderTo: 'container1',
- items: {
- store: store,
- xtype: 'piechart',
- dataField: 'visits',
- categoryField: 'name',
- //extra styles get applied to the chart defaults
- extraStyle:
- {
- legend:
- {
- display: 'bottom',
- padding: 5,
- font:
- {
- family: 'Tahoma',
- size: 13
- }
- }
- }
- }
- });
-
- // extra extra simple
- var panel2=new Ext.Panel({
- renderTo: 'container2',
- width:400,
- height:300,
- layout:'fit',
- items: {
- xtype: 'linechart',
- store: store,
- xField: 'name',
- yField: 'visits',
- listeners: {
- itemclick: function(o){
- var rec = store.getAt(o.index);
- Ext.example.msg('Item Selected', 'You chose {0}.', rec.get('name'));
- }
- }
- }
- });
-
- });
- </script>
- </head>
- <body>
- </body>
- </html>
|