Ext学习笔记(5):DrawComponent使用 Demo
2013-08-31 17:43
483 查看
<html> <head> <!-- Ext DrawComponent Demo --> <script src="js/ext-all.js"></script> <link href="css/ext-theme-gray-all.css" type="text/css" rel="stylesheet" /> <script type="text/javascript"> Ext.onReady(function() { var drawComponent = Ext.create('Ext.draw.Component', { width: 800, height: 600, renderTo: Ext.DomQuery.selectNode("div[@id='chart1']") }); /* Ext.draw.Component.surface 表面实例管理该组件*/ surface = drawComponent.surface; surface.add([{ type: 'circle', radius: 10, fill: '#f00', x: 10, y: 10, group: 'circles' }, { type: 'circle', radius: 10, fill: '#0f0', x: 50, y: 50, group: 'circles' }, { type: 'circle', radius: 10, fill: '#00f', x: 100, y: 100, group: 'circles' }, { type: 'rect', width: 20, height: 20, fill: '#f00', x: 10, y: 10, group: 'rectangles' }, { type: 'rect', width: 20, height: 20, fill: '#0f0', x: 50, y: 50, group: 'rectangles' },{ type: 'rect', width: 20, height: 20, fill: '#00f', x: 100, y: 100, group: 'rectangles' }]); // Get references to my groups circles = surface.getGroup('circles'); rectangles = surface.getGroup('rectangles'); // 使圆形竖直向下移动 circles.animate({ duration: 1000,//执行时间 to: { translate: { y: 200//y=y+200 } } }); // 使正方形水平向右移动 rectangles.animate({ duration: 1000,//执行时间 to: { translate: {//转化 x: 200//x=x+200 } } }); Ext.create('Ext.panel.Panel', { title: 'Panel with VerticalTextItem', width: 300, height: 200, lbar: { layout: { align: 'center' }, items: [{ xtype: 'text', text: 'Sample VerticalTextItem', degrees: 60//旋转60度角 }] }, renderTo: Ext.DomQuery.selectNode("div[@id='chart2']") }); }); </script> </head> <body> <div id="chart1" style="margin-left: 100px;"></div> <div id="chart2" style="margin-left: 100px;"></div> </body> </html>
相关文章推荐
- Ext学习笔记(1):Panel配置及使用Demo
- Ext学习笔记(2):Element使用Demo
- ExtJs 学习笔记基础篇 Ext组件的使用第1/2页
- Extjs学习笔记——Ext.data.JsonStore使用说明
- 【Ext.Net学习笔记】01:在ASP.NET WebForm中使用Ext.Net
- ng2学习笔记之bootstrap中的component使用教程
- APIDemo学习笔记——Android上几种简单的Animation使用方法(三)——3D Transition
- Ext学习笔记04 - UI组件 - Component, Button
- [转]ExtJs4 笔记(13) Ext.menu.Menu 菜单、Ext.draw.Component 绘图、Ext.resizer.Resizer 大小变更
- 【Ext.Net学习笔记】04:Ext.Net中使用数据、Ext.Net Store的用法、Ext.Net ComboBox用法
- APIDemo学习笔记——Android上几种简单的Animation使用方法(二)
- ExtJs4 笔记(13) Ext.menu.Menu 菜单、Ext.draw.Component 绘图、Ext.resizer.Resizer 大小变更
- APIDemo学习笔记——Android上几种简单的Animation使用方法
- [cocos2d-x学习笔记][入门基础]Box-2d物理引擎的使用02制作一个简易的愤怒小鸟Demo
- ExtJs4 笔记(13) Ext.menu.Menu 菜单、Ext.draw.Component 绘图、Ext.resizer.Resizer 大小变更
- Ext学习笔记(6):FormPanel 的Demo
- 【Ext.Net学习笔记】04:Ext.Net中使用数据、Ext.Net Store的用法、Ext.Net ComboBox用法
- ExtJs4 笔记(13) Ext.menu.Menu 菜单、Ext.draw.Component 绘图、Ext.resizer.Resizer 大小变更
- ExtJs 学习笔记基础篇 Ext组件的使用第1/2页
- APIDemo学习笔记——Android上几种简单的Animation使用方法(一)