├── .gitignore ├── doc ├── 1.create_mysqlDB.sql ├── 2.create_sqlserverDB.sql ├── 3.insert_mysqlData.sql └── readme.png ├── pom.xml ├── readme.md └── src ├── main ├── java │ └── repo │ │ └── xirong │ │ └── java │ │ └── demo │ │ ├── controller │ │ └── HomeController.java │ │ ├── mapper │ │ └── TestMapper.java │ │ ├── model │ │ └── User.java │ │ └── service │ │ ├── TestService.java │ │ └── TestServiceImpl.java ├── resources │ ├── config │ │ ├── jdbc.properties │ │ ├── log4j.xml │ │ ├── spring-mybatis-config.xml │ │ ├── spring-root-context.xml │ │ ├── spring-servlet-context.xml │ │ └── sys.properties │ └── mapper │ │ └── test.xml └── webapp │ ├── WEB-INF │ ├── views │ │ ├── common │ │ │ ├── _header.ftl │ │ │ └── _layout.ftl │ │ ├── home.ftl │ │ └── test.ftl │ └── web.xml │ └── resources │ ├── css │ ├── main.css │ ├── semantic.css │ ├── semantic.min.css │ └── themes │ │ ├── basic │ │ └── assets │ │ │ └── fonts │ │ │ ├── icons.eot │ │ │ ├── icons.svg │ │ │ ├── icons.ttf │ │ │ └── icons.woff │ │ └── default │ │ └── assets │ │ ├── fonts │ │ ├── icons.eot │ │ ├── icons.otf │ │ ├── icons.svg │ │ ├── icons.ttf │ │ ├── icons.woff │ │ └── icons.woff2 │ │ └── images │ │ └── flags.png │ ├── images │ ├── bg.jpg │ └── favicon.ico │ └── js │ ├── dist │ ├── chart │ │ ├── bar.js │ │ ├── chord.js │ │ ├── eventRiver.js │ │ ├── force.js │ │ ├── funnel.js │ │ ├── gauge.js │ │ ├── k.js │ │ ├── line.js │ │ ├── map.js │ │ ├── pie.js │ │ ├── radar.js │ │ └── scatter.js │ ├── echarts-all.js │ └── echarts.js │ ├── echarts │ ├── chart │ │ ├── bar.js │ │ ├── chord.js │ │ ├── eventRiver.js │ │ ├── force.js │ │ ├── funnel.js │ │ ├── gauge.js │ │ ├── k.js │ │ ├── line.js │ │ ├── map.js │ │ ├── pie.js │ │ ├── radar.js │ │ └── scatter.js │ ├── echarts-all.js │ └── echarts.js │ ├── exceptiondetail.js │ ├── exceptionreport.js │ ├── jquery-2.1.1.js │ ├── jquery-2.1.1.min.js │ ├── jquery.loadTemplate-1.4.4.min.js │ ├── orderreport.js │ ├── semantic.js │ ├── semantic.min.js │ └── tablesort.min.js └── test └── java └── repo └── xirong └── java └── demo └── controller └── HomeControllerTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea/ 3 | *.class 4 | target/ 5 | bin/ 6 | *.iml 7 | ~$*.xlsx 8 | .project 9 | .settings/ 10 | .classpath 11 | -------------------------------------------------------------------------------- /doc/1.create_mysqlDB.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * 测试库 demoDB 的创建脚本 3 | */ 4 | create database if not exists demoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; 5 | 6 | 7 | /* 8 | * 测试表 user 的创建 9 | */ 10 | use demoDB; 11 | 12 | create table user 13 | ( 14 | user_id int not null auto_increment, 15 | name varchar(64) not null default '', 16 | age int not null default 0 comment '用户年龄', 17 | sex int not null default 0 comment '0=男,1=女', 18 | create_time datetime not null default '2014-09-01', 19 | _timestamp timestamp not null default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 20 | primary key (user_id) 21 | ) 22 | ENGINE = InnoDB 23 | DEFAULT CHARACTER SET = utf8 24 | COLLATE = utf8_general_ci 25 | AUTO_INCREMENT = 1; 26 | 27 | alter table user comment '测试例子表user'; 28 | 29 | 30 | -------------------------------------------------------------------------------- /doc/2.create_sqlserverDB.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/doc/2.create_sqlserverDB.sql -------------------------------------------------------------------------------- /doc/3.insert_mysqlData.sql: -------------------------------------------------------------------------------- 1 | # 插入一些测试数据 2 | use demoDB; 3 | insert into user (name ,age,sex ,create_time) values('张三',20,0,'2014-05-27 18:12:59'); 4 | insert into user (name ,age,sex ,create_time) values('李四',30,0,'2014-05-27 18:12:59'); 5 | insert into user (name ,age,sex ,create_time) values('王二麻子',18,1,'2014-05-27 18:12:59'); -------------------------------------------------------------------------------- /doc/readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/doc/readme.png -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | war 8 | 9 | demo 10 | repo.xirong.java 11 | 1.0-SNAPSHOT 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | UTF-8 23 | 1.7 24 | 3.2.3.RELEASE 25 | 1.7.2 26 | 1.7.5 27 | UTF-8 28 | 29 | 30 | 31 | 32 | org.springframework 33 | spring-context 34 | ${org.springframework-version} 35 | 36 | 37 | 38 | commons-logging 39 | commons-logging 40 | 41 | 42 | 43 | 44 | org.springframework 45 | spring-webmvc 46 | ${org.springframework-version} 47 | 48 | 49 | org.springframework 50 | spring-tx 51 | ${org.springframework-version} 52 | 53 | 54 | 55 | org.springframework 56 | spring-jdbc 57 | ${org.springframework-version} 58 | 59 | 60 | 61 | org.springframework 62 | spring-web 63 | ${org.springframework-version} 64 | 65 | 66 | 67 | org.springframework 68 | spring-context-support 69 | ${org.springframework-version} 70 | 71 | 72 | 73 | 74 | org.aspectj 75 | aspectjrt 76 | ${org.aspectj-version} 77 | 78 | 79 | org.aspectj 80 | aspectjweaver 81 | ${org.aspectj-version} 82 | 83 | 84 | 85 | 86 | org.slf4j 87 | slf4j-api 88 | ${org.slf4j-version} 89 | 90 | 91 | org.slf4j 92 | jcl-over-slf4j 93 | ${org.slf4j-version} 94 | runtime 95 | 96 | 97 | org.slf4j 98 | slf4j-log4j12 99 | ${org.slf4j-version} 100 | runtime 101 | 102 | 103 | log4j 104 | log4j 105 | 1.2.17 106 | 107 | 108 | javax.mail 109 | mail 110 | 111 | 112 | javax.jms 113 | jms 114 | 115 | 116 | com.sun.jdmk 117 | jmxtools 118 | 119 | 120 | com.sun.jmx 121 | jmxri 122 | 123 | 124 | runtime 125 | 126 | 127 | log4j 128 | apache-log4j-extras 129 | 1.1 130 | 131 | 132 | 133 | 134 | 135 | javax.inject 136 | javax.inject 137 | 1 138 | 139 | 140 | 141 | 142 | javax.servlet 143 | javax.servlet-api 144 | 3.1.0 145 | 146 | 147 | 148 | junit 149 | junit 150 | 4.7 151 | test 152 | 153 | 154 | org.mockito 155 | mockito-all 156 | 1.7 157 | 158 | 159 | 160 | com.alibaba 161 | fastjson 162 | 1.1.37 163 | 164 | 165 | 166 | 167 | mysql 168 | mysql-connector-java 169 | 5.1.31 170 | 171 | 172 | com.microsoft.sqlserver 173 | sqljdbc4 174 | 4.0 175 | 176 | 177 | commons-dbcp 178 | commons-dbcp 179 | 1.4 180 | 181 | 182 | org.mybatis 183 | mybatis-spring 184 | 1.2.2 185 | 186 | 187 | org.mybatis 188 | mybatis 189 | 3.2.7 190 | 191 | 192 | jstl 193 | jstl 194 | 1.2 195 | 196 | 197 | 198 | org.freemarker 199 | freemarker 200 | 2.3.20 201 | 202 | 203 | org.springframework 204 | spring-context-support 205 | ${org.springframework-version} 206 | 207 | 208 | 209 | org.springframework 210 | spring-context 211 | ${org.springframework-version} 212 | 213 | 214 | 215 | commons-logging 216 | commons-logging 217 | 218 | 219 | 220 | 221 | org.springframework 222 | spring-jdbc 223 | ${org.springframework-version} 224 | 225 | 226 | 227 | org.apache.commons 228 | commons-lang3 229 | 3.2 230 | 231 | 232 | org.codehaus.jackson 233 | jackson-core-asl 234 | 1.8.4 235 | 236 | 237 | org.codehaus.jackson 238 | jackson-mapper-asl 239 | 1.8.4 240 | 241 | 242 | commons-configuration 243 | commons-configuration 244 | 1.9 245 | 246 | 247 | 248 | 249 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 本 repository 是最初学习Java开发时候做的一个例子,后续慢慢维护,希望成为最简单、最全的入门例子,麻雀虽小,五脏俱全 3 | 使用到的技术如下: 4 | 5 | - maven 项目管理 6 | - spring mvc 框架 7 | - mybatis 持久层框架,例子中包括MySQL、SqlServer的连接案例,包含取多条(list)转换、where条件的in案例等[动态sql例子](https://mybatis.github.io/mybatis-3/zh/dynamic-sql.html),详细可以阅读[mybaits动态sql语句学习](http://limingnihao.iteye.com/blog/782190) 8 | - freemarker 模板框架 9 | 10 | 其它: 11 | - [semantic ui前端框架](http://www.semantic-ui.com/),负责整体的css、布局、交互等; 12 | 13 | # 使用方法 14 | 1. fork 代码 15 | 2. 使用工具 idea 或者 eclipe 导入 现有maven项目,maven会自动下载所以来的jar包; 16 | 3. 将 `doc` 文件夹中的sql脚本部署到MySQL中,取的MySQL连接串,修改 `jdbc.properties` 中MySQL节点的url、user、password 17 | 4. 调试代码,即可在页面中看到效果 18 | ![doc/readme.png](doc/readme.png) -------------------------------------------------------------------------------- /src/main/java/repo/xirong/java/demo/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package repo.xirong.java.demo.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | import org.springframework.web.servlet.ModelAndView; 9 | import repo.xirong.java.demo.model.User; 10 | import repo.xirong.java.demo.service.TestService; 11 | 12 | import java.util.ArrayList; 13 | 14 | /** 15 | * Created by xirong on 15/1/28. 16 | */ 17 | @Controller 18 | public class HomeController { 19 | @Autowired 20 | private TestService service; 21 | // 22 | // @Autowired 23 | // private OrderStatisticService orderStatisticService; 24 | 25 | @RequestMapping(value="/") 26 | public ModelAndView index(Model model) 27 | { 28 | ModelAndView mv =new ModelAndView(); 29 | mv.setViewName("home"); 30 | 31 | // ArrayList users=service.getAllUsers(); 32 | // mv.addObject("userList",users); 33 | 34 | return mv; 35 | } 36 | 37 | @RequestMapping(value="/test") 38 | public ModelAndView test(Model model) 39 | { 40 | ModelAndView mv =new ModelAndView(); 41 | mv.setViewName("test"); 42 | 43 | return mv; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/repo/xirong/java/demo/mapper/TestMapper.java: -------------------------------------------------------------------------------- 1 | package repo.xirong.java.demo.mapper; 2 | 3 | import repo.xirong.java.demo.model.User; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import java.util.ArrayList; 7 | 8 | 9 | @Repository 10 | public interface TestMapper { 11 | 12 | ArrayList getAllUsers (); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/repo/xirong/java/demo/model/User.java: -------------------------------------------------------------------------------- 1 | package repo.xirong.java.demo.model; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | * description: 7 | * author: xirong 8 | * date: 2015-05-27 9 | * version: 1.0 10 | * copyright 2015 elong Inc ,all rights reserved. 11 | */ 12 | public class User { 13 | private int user_id; 14 | private String name; 15 | private int age; 16 | private int sex ; 17 | private Date create_time; 18 | 19 | public int getUser_id() { 20 | return user_id; 21 | } 22 | 23 | public void setUser_id(int user_id) { 24 | this.user_id = user_id; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | 35 | public int getAge() { 36 | return age; 37 | } 38 | 39 | public void setAge(int age) { 40 | this.age = age; 41 | } 42 | 43 | public Date getCreate_time() { 44 | return create_time; 45 | } 46 | 47 | public void setCreate_time(Date create_time) { 48 | this.create_time = create_time; 49 | } 50 | 51 | public int getSex() { 52 | return sex; 53 | } 54 | 55 | public void setSex(int sex) { 56 | this.sex = sex; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/repo/xirong/java/demo/service/TestService.java: -------------------------------------------------------------------------------- 1 | package repo.xirong.java.demo.service; 2 | 3 | import repo.xirong.java.demo.model.User; 4 | 5 | import java.util.ArrayList; 6 | 7 | /** 8 | * description: 9 | * author: xirong 10 | * date: 2015-02-28 11 | * version: 1.0 12 | * copyright 2015 elong Inc ,all rights reserved. 13 | */ 14 | public interface TestService { 15 | ArrayList getAllUsers (); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/repo/xirong/java/demo/service/TestServiceImpl.java: -------------------------------------------------------------------------------- 1 | package repo.xirong.java.demo.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import repo.xirong.java.demo.mapper.TestMapper; 6 | import repo.xirong.java.demo.model.User; 7 | 8 | import java.util.ArrayList; 9 | 10 | /** 11 | * description: 12 | * author: xirong 13 | * date: 2015-05-27 14 | * version: 1.0 15 | * copyright 2015 elong Inc ,all rights reserved. 16 | */ 17 | @Service 18 | public class TestServiceImpl implements TestService{ 19 | @Autowired 20 | private TestMapper testMapper; 21 | 22 | @Override 23 | public ArrayList getAllUsers() { 24 | return testMapper.getAllUsers(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/config/jdbc.properties: -------------------------------------------------------------------------------- 1 | # sqlserver 2 | sqlserver.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver 3 | testSqlServer.url=jdbc:sqlserver://192.168.69.13;databaseName=log_error 4 | testSqlServer.user=log_error_owner 5 | testSqlServer.password=log_error_owner 6 | 7 | # mysql 8 | read.driver=com.mysql.jdbc.Driver 9 | read.url=jdbc:mysql://192.168.69.15:6015/demoDB 10 | read.user=liangyong.guo 11 | read.password=123456 12 | #最大连接数量 13 | read.maxActive=100 14 | read.maxIdle=50 15 | # 16 | read.maxWait=10000 17 | read.timeBetweenEvictionRunsMillis=3600000 18 | read.testWhileIdle=true 19 | #是否自动回收超时连接 20 | read.removeAbandoned=true 21 | #超时时间(以秒数为单位) 22 | read.removeAbandonedTimeout=300 23 | -------------------------------------------------------------------------------- /src/main/resources/config/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/main/resources/config/spring-mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/config/spring-root-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/config/spring-servlet-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 53 | 54 | 55 | select 1 from DUAL 56 | 57 | 58 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 10 122 | zh_CN 123 | yyyy-MM-dd 124 | yyyy-MM-dd 125 | #.## 126 | 127 | 128 | 129 | 130 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 177 | 178 | 179 | application/json;charset=UTF-8 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /src/main/resources/config/sys.properties: -------------------------------------------------------------------------------- 1 | #/表格中显示异常红色对比的倍数值,当今日异常大于同比环比的多少倍时候,显示红色 2 | redEXNum=4 -------------------------------------------------------------------------------- /src/main/resources/mapper/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/common/_header.ftl: -------------------------------------------------------------------------------- 1 | <#macro header > 2 | 10 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/common/_layout.ftl: -------------------------------------------------------------------------------- 1 | <#macro layoutHead title > 2 | 3 | 4 | 5 | 6 | ${title!""} - 日志监控平台 7 | 8 | 9 | 10 | 11 | <#nested> 12 | 13 | 14 | 15 | 16 | <#macro layoutBody> 17 | 18 | 19 | <#include "_header.ftl" > 20 | <@header> 21 | 22 | 23 | 24 | 25 | 26 | <#nested> 27 | 28 | 29 | 30 | 31 | <#macro layoutFooter> 32 | 33 | 34 | 35 | <#nested> 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/home.ftl: -------------------------------------------------------------------------------- 1 | <#include "common/_layout.ftl"> 2 | <@layoutHead title="网站"> 3 | 4 | <@layoutBody> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <#----> 16 | 17 | 18 | 19 | <#list userList as oneUser> 20 | 21 | 22 | 23 | 24 | <#if oneUser.sex==1> 25 | 26 | <#else> 27 | 28 | 29 | <#----> 30 | 31 | 32 | 33 |
UserIdNameAgeSexCreateTime
${oneUser.user_id}${oneUser.name}${oneUser.age}${oneUser.create_time}
34 | 35 | 36 | 37 | 38 | <@layoutFooter> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/test.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |

nihao

5 |

ddd

6 |
7 | 8 | 9 | 10 |
11 |

12 | 13 | xirong 14 |

15 | 16 | <#----> 17 |

5key

18 |
天行健,君子以自强不息!
19 |

Work @ Elong, Software Engineer

20 |

China · Beijing

21 | 25 | 29 |
30 | 31 | Google Plus 32 |
33 |

Weibo · Twitter · Zhihu · Linkedin

34 |
35 | 36 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | contextConfigLocation 10 | classpath:/config/spring-root-context.xml 11 | 12 | 13 | 14 | 15 | org.springframework.web.context.ContextLoaderListener 16 | 17 | 18 | 19 | 20 | log4jConfigLocation 21 | classpath:config/log4j.xml 22 | 23 | 24 | log4jRefreshInterval 25 | 60000 26 | 27 | 28 | org.springframework.web.util.Log4jConfigListener 29 | 30 | 31 | 32 | 33 | org.springframework.web.context.request.RequestContextListener 34 | 35 | 36 | 37 | appServlet 38 | org.springframework.web.servlet.DispatcherServlet 39 | 40 | contextConfigLocation 41 | classpath:/config/spring-servlet-context.xml 42 | 43 | 1 44 | 45 | 46 | 47 | appServlet 48 | / 49 | 50 | 51 | 52 | 53 | CharacterEncodingFilter 54 | org.springframework.web.filter.CharacterEncodingFilter 55 | 56 | encoding 57 | utf-8 58 | 59 | 60 | forceEncoding 61 | true 62 | 63 | 64 | 65 | CharacterEncodingFilter 66 | /* 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/main/webapp/resources/css/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0px; 3 | padding: 0px; 4 | color: #555555; 5 | height: 100%; 6 | } 7 | 8 | a { 9 | color: #009FDA; 10 | cursor: pointer; 11 | } 12 | 13 | #header { 14 | height: 50px; 15 | } 16 | 17 | .ui.menu .c-logo { 18 | font-size: 18px; 19 | 20 | } 21 | 22 | .ui.menu .c-logo:hover .icon { 23 | color: #009FDA; 24 | } 25 | 26 | .ui.menu .icon.upload { 27 | font-size: 22px; 28 | } 29 | 30 | .ui.menu .c-copyright { 31 | font-size: 13px; 32 | margin-top: 5px; 33 | } 34 | 35 | .ui.menu .item.c-userinfo { 36 | font-size: 13px; 37 | margin-top: 10px; 38 | } 39 | 40 | .main.container { 41 | padding: 10px; 42 | } 43 | 44 | .c-ml1 { 45 | margin-left: 10px; 46 | } 47 | 48 | .c-mr1 { 49 | margin-right: 10px; 50 | } 51 | 52 | .table-striped > tbody > tr:nth-child(odd) > td, 53 | .table-striped > tbody > tr:nth-child(odd) > th { 54 | background-color: #f9f9f9; 55 | } 56 | 57 | tbody > tr:hover > td { 58 | background-color: #F6F3D5; 59 | } 60 | 61 | .ui.hidden { 62 | display: none; 63 | } 64 | 65 | /* override semantic css */ 66 | .ui.modal > .header { 67 | padding: 0.8rem 1rem; 68 | } 69 | 70 | .ui.modal > .content { 71 | padding: 1.5rem; 72 | } 73 | 74 | .ui.modal > .content textarea { 75 | height: 1rem; 76 | } 77 | 78 | .ui.modal .actions { 79 | padding: 1rem 1.5rem; 80 | } 81 | 82 | .ui.grid > .row { 83 | margin-top: 0; 84 | } 85 | 86 | .ui.progress { 87 | height: 20px; 88 | padding: 1px; 89 | } 90 | 91 | /* custom css */ 92 | -------------------------------------------------------------------------------- /src/main/webapp/resources/css/themes/basic/assets/fonts/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/css/themes/basic/assets/fonts/icons.eot -------------------------------------------------------------------------------- /src/main/webapp/resources/css/themes/basic/assets/fonts/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/css/themes/basic/assets/fonts/icons.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/css/themes/basic/assets/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/css/themes/basic/assets/fonts/icons.woff -------------------------------------------------------------------------------- /src/main/webapp/resources/css/themes/default/assets/fonts/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/css/themes/default/assets/fonts/icons.eot -------------------------------------------------------------------------------- /src/main/webapp/resources/css/themes/default/assets/fonts/icons.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/css/themes/default/assets/fonts/icons.otf -------------------------------------------------------------------------------- /src/main/webapp/resources/css/themes/default/assets/fonts/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/css/themes/default/assets/fonts/icons.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/css/themes/default/assets/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/css/themes/default/assets/fonts/icons.woff -------------------------------------------------------------------------------- /src/main/webapp/resources/css/themes/default/assets/fonts/icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/css/themes/default/assets/fonts/icons.woff2 -------------------------------------------------------------------------------- /src/main/webapp/resources/css/themes/default/assets/images/flags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/css/themes/default/assets/images/flags.png -------------------------------------------------------------------------------- /src/main/webapp/resources/images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/images/bg.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xirong/springmvc-mybatis-maven/4df3c07fa245812ad7dfde5312dc4cff9d74d2b2/src/main/webapp/resources/images/favicon.ico -------------------------------------------------------------------------------- /src/main/webapp/resources/js/dist/chart/bar.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/bar",["require","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.bar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_BAR,_buildShape:function(){this._buildPosition()},_buildNormal:function(e,t,i,o,r){for(var s,l,h,d,m,c,p,u,V,U,g,y,f=this.series,b=i[0][0],_=f[b],x="horizontal"==r,k=this.component.xAxis,L=this.component.yAxis,v=x?k.getAxis(_.xAxisIndex):L.getAxis(_.yAxisIndex),W=this._mapSize(v,i),w=W.gap,X=W.barGap,I=W.barWidthMap,K=W.barMaxWidthMap,S=W.barWidth,C=W.barMinHeightMap,T=W.interval,E=this.deepQuery([this.ecTheme,a],"island.r"),z=0,A=t;A>z&&null!=v.getNameByIndex(z);z++){x?d=v.getCoordByIndex(z)-w/2:m=v.getCoordByIndex(z)+w/2;for(var M=0,J=i.length;J>M;M++){var F=f[i[M][0]].yAxisIndex||0,O=f[i[M][0]].xAxisIndex||0;s=x?L.getAxis(F):k.getAxis(O),p=c=V=u=s.getCoord(0);for(var P=0,D=i[M].length;D>P;P++)b=i[M][P],_=f[b],g=_.data[z],y=this.getDataFromOption(g,"-"),o[b]=o[b]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},h=Math.min(K[b]||Number.MAX_VALUE,I[b]||S),"-"!==y&&(y>0?(l=P>0?s.getCoordSize(y):x?p-s.getCoord(y):s.getCoord(y)-p,1===D&&C[b]>l&&(l=C[b]),x?(c-=l,m=c):(d=c,c+=l)):0>y?(l=P>0?s.getCoordSize(y):x?s.getCoord(y)-V:V-s.getCoord(y),1===D&&C[b]>l&&(l=C[b]),x?(m=u,u+=l):(u-=l,d=u)):(l=0,x?(c-=l,m=c):(d=c,c+=l)),o[b][z]=x?d+h/2:m-h/2,o[b].min>y&&(o[b].min=y,x?(o[b].minY=m,o[b].minX=o[b][z]):(o[b].minX=d+l,o[b].minY=o[b][z])),o[b].maxP;P++)b=i[M][P],_=f[b],g=_.data[z],y=this.getDataFromOption(g,"-"),h=Math.min(K[b]||Number.MAX_VALUE,I[b]||S),"-"==y&&this.deepQuery([g,_,this.option],"calculable")&&(x?(c-=E,m=c):(d=c,c+=E),U=this._getBarItem(b,z,v.getNameByIndex(z),d,m-(x?0:h),x?h:E,x?E:h,x?"vertical":"horizontal"),U.hoverable=!1,U.draggable=!1,U.style.lineWidth=1,U.style.brushType="stroke",U.style.strokeColor=_.calculableHolderColor||this.ecTheme.calculableHolderColor||a.calculableHolderColor,this.shapeList.push(new n(U)));x?d+=h+X:m-=h+X}}this._calculMarkMapXY(o,i,x?"y":"x")},_buildHorizontal:function(e,t,i,n){return this._buildNormal(e,t,i,n,"horizontal")},_buildVertical:function(e,t,i,n){return this._buildNormal(e,t,i,n,"vertical")},_buildOther:function(e,t,i,a){for(var o=this.series,r=0,s=i.length;s>r;r++)for(var l=0,h=i[r].length;h>l;l++){var d=i[r][l],m=o[d],c=m.xAxisIndex||0,p=this.component.xAxis.getAxis(c),u=p.getCoord(0),V=m.yAxisIndex||0,U=this.component.yAxis.getAxis(V),g=U.getCoord(0);a[d]=a[d]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var y=0,f=m.data.length;f>y;y++){var b=m.data[y],_=this.getDataFromOption(b,"-");if(_ instanceof Array){var x,k,L=p.getCoord(_[0]),v=U.getCoord(_[1]),W=[b,m],w=this.deepQuery(W,"barWidth")||10,X=this.deepQuery(W,"barHeight");null!=X?(x="horizontal",_[0]>0?(w=L-u,L-=w):w=_[0]<0?u-L:0,k=this._getBarItem(d,y,_[0],L,v-X/2,w,X,x)):(x="vertical",_[1]>0?X=g-v:_[1]<0?(X=v-g,v-=X):X=0,k=this._getBarItem(d,y,_[0],L-w/2,v,w,X,x)),this.shapeList.push(new n(k)),L=p.getCoord(_[0]),v=U.getCoord(_[1]),a[d].min0>_[0]&&(a[d].min0=_[0],a[d].minY0=v,a[d].minX0=L),a[d].max0<_[0]&&(a[d].max0=_[0],a[d].maxY0=v,a[d].maxX0=L),a[d].sum0+=_[0],a[d].counter0++,a[d].min1>_[1]&&(a[d].min1=_[1],a[d].minY1=v,a[d].minX1=L),a[d].max1<_[1]&&(a[d].max1=_[1],a[d].maxY1=v,a[d].maxX1=L),a[d].sum1+=_[1],a[d].counter1++}}}this._calculMarkMapXY(a,i,"xy")},_mapSize:function(e,t,i){var n,a,o=this._findSpecialBarSzie(t,i),r=o.barWidthMap,s=o.barMaxWidthMap,l=o.barMinHeightMap,h=o.sBarWidthCounter,d=o.sBarWidthTotal,m=o.barGap,c=o.barCategoryGap,p=1;if(t.length!=h){if(i)n=e.getGap(),m=0,a=+(n/t.length).toFixed(2),0>=a&&(p=Math.floor(t.length/n),a=1);else if(n="string"==typeof c&&c.match(/%$/)?(e.getGap()*(100-parseFloat(c))/100).toFixed(2)-0:e.getGap()-c,"string"==typeof m&&m.match(/%$/)?(m=parseFloat(m)/100,a=+((n-d)/((t.length-1)*m+t.length-h)).toFixed(2),m=a*m):(m=parseFloat(m),a=+((n-d-m*(t.length-1))/(t.length-h)).toFixed(2)),0>=a)return this._mapSize(e,t,!0)}else if(n=h>1?"string"==typeof c&&c.match(/%$/)?+(e.getGap()*(100-parseFloat(c))/100).toFixed(2):e.getGap()-c:d,a=0,m=h>1?+((n-d)/(h-1)).toFixed(2):0,0>m)return this._mapSize(e,t,!0);return this._recheckBarMaxWidth(t,r,s,l,n,a,m,p)},_findSpecialBarSzie:function(e,t){for(var i,n,a,o,r=this.series,s={},l={},h={},d=0,m=0,c=0,p=e.length;p>c;c++)for(var u={barWidth:!1,barMaxWidth:!1},V=0,U=e[c].length;U>V;V++){var g=e[c][V],y=r[g];if(!t){if(u.barWidth)s[g]=i;else if(i=this.query(y,"barWidth"),null!=i){s[g]=i,m+=i,d++,u.barWidth=!0;for(var f=0,b=V;b>f;f++){var _=e[c][f];s[_]=i}}if(u.barMaxWidth)l[g]=n;else if(n=this.query(y,"barMaxWidth"),null!=n){l[g]=n,u.barMaxWidth=!0;for(var f=0,b=V;b>f;f++){var _=e[c][f];l[_]=n}}}h[g]=this.query(y,"barMinHeight"),a=null!=a?a:this.query(y,"barGap"),o=null!=o?o:this.query(y,"barCategoryGap")}return{barWidthMap:s,barMaxWidthMap:l,barMinHeightMap:h,sBarWidth:i,sBarMaxWidth:n,sBarWidthCounter:d,sBarWidthTotal:m,barGap:a,barCategoryGap:o}},_recheckBarMaxWidth:function(e,t,i,n,a,o,r,s){for(var l=0,h=e.length;h>l;l++){var d=e[l][0];i[d]&&i[d]0&&f.height>y&&f.width>y?(f.y+=y/2,f.height-=y,f.x+=y/2,f.width-=y):f.brushType="fill",d.highlightStyle.textColor=d.highlightStyle.color,d=this.addLabel(d,c,p,i,h);var b=f.textPosition;if("insideLeft"===b||"insideRight"===b||"insideTop"===b||"insideBottom"===b){var _=5;switch(b){case"insideLeft":f.textX=f.x+_,f.textY=f.y+f.height/2,f.textAlign="left",f.textBaseline="middle";break;case"insideRight":f.textX=f.x+f.width-_,f.textY=f.y+f.height/2,f.textAlign="right",f.textBaseline="middle";break;case"insideTop":f.textX=f.x+f.width/2,f.textY=f.y+_/2,f.textAlign="center",f.textBaseline="top";break;case"insideBottom":f.textX=f.x+f.width/2,f.textY=f.y+f.height-_/2,f.textAlign="center",f.textBaseline="bottom"}f.textPosition="specific",f.textColor=f.textColor||"#fff"}return this.deepQuery([p,c,this.option],"calculable")&&(this.setCalculable(d),d.draggable=!0),o.pack(d,m[e],e,m[e].data[t],t,i),d},getMarkCoord:function(e,t){var i,n,a=this.series[e],o=this.xMarkMap[e],r=this.component.xAxis.getAxis(a.xAxisIndex),s=this.component.yAxis.getAxis(a.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)if(o.isHorizontal){i="string"==typeof t.xAxis&&r.getIndexByName?r.getIndexByName(t.xAxis):t.xAxis||0;var l=o[i];l=null!=l?l:"string"!=typeof t.xAxis&&r.getCoordByIndex?r.getCoordByIndex(t.xAxis||0):r.getCoord(t.xAxis||0),n=[l,s.getCoord(t.yAxis||0)]}else{i="string"==typeof t.yAxis&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var h=o[i];h=null!=h?h:"string"!=typeof t.yAxis&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),n=[r.getCoord(t.xAxis||0),h]}else{var d=null!=t.valueIndex?t.valueIndex:null!=o.maxX0?"1":"";n=[o[t.type+"X"+d],o[t.type+"Y"+d],o[t.type+"Line"+d],o[t.type+d]]}return n},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var r,s,l,h,d,m,c,n=this.shapeList.length-1;n>=0;n--)if(m=o.get(this.shapeList[n],"seriesIndex"),i[m]&&!i[m][3]&&"rectangle"===this.shapeList[n].type){if(c=o.get(this.shapeList[n],"dataIndex"),d=t[m],i[m][2]&&c===d.data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[m][2]&&0===c){this.zr.delShape(this.shapeList[n].id);continue}"horizontal"===this.shapeList[n]._orient?(h=this.component.yAxis.getAxis(d.yAxisIndex||0).getGap(),l=i[m][2]?-h:h,r=0):(s=this.component.xAxis.getAxis(d.xAxisIndex||0).getGap(),r=i[m][2]?s:-s,l=0),this.shapeList[n].position=[0,0],this.zr.animate(this.shapeList[n].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[r,l]}).start()}}},r.inherits(t,i),e("../chart").define("bar",t),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/dist/chart/eventRiver.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/eventRiver",["require","./base","../layout/eventRiver","zrender/shape/Polygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","../util/date","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o);var r=this;r._ondragend=function(){r.isDragend=!0},this.refresh(a)}var i=e("./base"),n=e("../layout/eventRiver"),a=e("zrender/shape/Polygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var o=e("../config");o.eventRiver={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"inside",formatter:"{b}"}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0}}}};var r=e("../util/ecData"),s=e("../util/date"),l=e("zrender/tool/util"),h=e("zrender/tool/color");return t.prototype={type:o.CHART_TYPE_EVENTRIVER,_buildShape:function(){var e=this.series;this.selectedMap={},this._dataPreprocessing();for(var t=this.component.legend,i=[],a=0;an;n++)if(i[n].type===this.type){e=this.component.xAxis.getAxis(i[n].xAxisIndex||0);for(var o=0,r=i[n].eventList.length;r>o;o++){t=i[n].eventList[o].evolution;for(var l=0,h=t.length;h>l;l++)t[l].timeScale=e.getCoord(s.getNewDate(t[l].time)-0),t[l].valueScale=Math.pow(t[l].value,.8)}}this._intervalX=Math.round(this.component.grid.getWidth()/40)},_drawEventRiver:function(){for(var e=this.series,t=0;ta)){for(var o=[],r=[],s=0;a>s;s++)o.push(n[s].timeScale),r.push(n[s].valueScale);var l=[];l.push([o[0],i]);var s=0;for(s=0;a-1>s;s++)l.push([(o[s]+o[s+1])/2,r[s]/-2+i]);for(l.push([(o[s]+(o[s]+t))/2,r[s]/-2+i]),l.push([o[s]+t,i]),l.push([(o[s]+(o[s]+t))/2,r[s]/2+i]),s=a-1;s>0;s--)l.push([(o[s]+o[s-1])/2,r[s-1]/2+i]);return l}},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1)},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},l.inherits(t,i),e("../chart").define("eventRiver",t),t}),define("echarts/layout/eventRiver",["require"],function(){function e(e,o,r){function s(e,t){var i=e.importance,n=t.importance;return i>n?-1:n>i?1:0}function l(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;n>i;i++)if(e[i]===t)return i;return-1}for(var h=5,m=o,V=0;Ve+1){var a=Math.round((e+t)/2);n.leftChild=i(e,a),n.rightChild=i(a,t)}return n}function n(e,t,i){if(1>i-t)return 0;var a=Math.round((e.left+e.right)/2),o=0;if(t==e.left&&i==e.right)o=e.maxValue;else if(a>=i&&null!=e.leftChild)o=n(e.leftChild,t,i);else if(t>=a&&null!=e.rightChild)o=n(e.rightChild,t,i);else{var r=0,s=0;null!=e.leftChild&&(r=n(e.leftChild,t,a)),null!=e.rightChild&&(s=n(e.rightChild,a,i)),o=r>s?r:s}return o}function a(e,t,i,n){if(null!=e){var o=Math.round((e.left+e.right)/2);e.maxValue=e.maxValue>n?e.maxValue:n,(Math.floor(10*t)!=Math.floor(10*e.left)||Math.floor(10*i)!=Math.floor(10*e.right))&&(o>=i?a(e.leftChild,t,i,n):t>=o?a(e.rightChild,t,i,n):(a(e.leftChild,t,o,n),a(e.rightChild,o,i,n)))}}return e}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/dist/chart/funnel.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/funnel",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Polygon"),s=e("../config");s.funnel={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}};var r=e("../util/ecData"),l=e("../util/number"),h=e("zrender/tool/util"),m=e("zrender/tool/color"),V=e("zrender/tool/area");return t.prototype={type:s.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};for(var n,i=0,a=e.length;a>i;i++)if(e[i].type===s.CHART_TYPE_FUNNEL){if(e[i]=this.reformOption(e[i]),this.legendHoverLink=e[i].legendHoverLink||this.legendHoverLink,n=e[i].name||"",this.selectedMap[n]=t?t.isSelected(n):!0,!this.selectedMap[n])continue;this._buildSingleFunnel(i),this.buildMark(i)}this.addShapeList()},_buildSingleFunnel:function(e){var t=this.component.legend,n=this.series[e],i=this._mapData(e),a=this._getLocation(e);this._paramsMap[e]={location:a,data:i};for(var o,s=0,r=[],h=0,m=i.length;m>h;h++)o=i[h].name,this.selectedMap[o]=t?t.isSelected(o):!0,this.selectedMap[o]&&!isNaN(i[h].value)&&(r.push(i[h]),s++);if(0!==s){for(var V,U,d,p,c=this._buildFunnelCase(e),u=n.funnelAlign,y=n.gap,g=s>1?(a.height-(s-1)*y)/s:a.height,b=a.y,f="descending"===n.sort?this._getItemWidth(e,r[0].value):l.parsePercent(n.minSize,a.width),k="descending"===n.sort?1:0,x=a.centerX,_=[],h=0,m=r.length;m>h;h++)if(o=r[h].name,this.selectedMap[o]&&!isNaN(r[h].value)){switch(V=m-2>=h?this._getItemWidth(e,r[h+k].value):"descending"===n.sort?l.parsePercent(n.minSize,a.width):l.parsePercent(n.maxSize,a.width),u){case"left":U=a.x;break;case"right":U=a.x+a.width-f;break;default:U=x-f/2}d=this._buildItem(e,r[h]._index,t?t.getColor(o):this.zr.getColor(r[h]._index),U,b,f,V,g,u),b+=g+y,p=d.style.pointList,_.unshift([p[0][0]-10,p[0][1]]),_.push([p[1][0]+10,p[1][1]]),0===h&&(0===f?(p=_.pop(),"center"==u&&(_[0][0]+=10),"right"==u&&(_[0][0]=p[0]),_[0][1]-="center"==u?10:15,1==m&&(p=d.style.pointList)):(_[_.length-1][1]-=5,_[0][1]-=5)),f=V}c&&(_.unshift([p[3][0]-10,p[3][1]]),_.push([p[2][0]+10,p[2][1]]),0===f?(p=_.pop(),"center"==u&&(_[0][0]+=10),"right"==u&&(_[0][0]=p[0]),_[0][1]+="center"==u?10:15):(_[_.length-1][1]+=5,_[0][1]+=5),c.style.pointList=_)}},_buildFunnelCase:function(e){var t=this.series[e];if(this.deepQuery([t,this.option],"calculable")){var n=this._paramsMap[e].location,i=10,a={hoverable:!1,style:{pointListd:[[n.x-i,n.y-i],[n.x+n.width+i,n.y-i],[n.x+n.width+i,n.y+n.height+i],[n.x-i,n.y+n.height+i]],brushType:"stroke",lineWidth:1,strokeColor:t.calculableHolderColor||this.ecTheme.calculableHolderColor||s.calculableHolderColor}};return r.pack(a,t,e,void 0,-1),this.setCalculable(a),a=new o(a),this.shapeList.push(a),a}},_getLocation:function(e){var t=this.series[e],n=this.zr.getWidth(),i=this.zr.getHeight(),a=this.parsePercent(t.x,n),o=this.parsePercent(t.y,i),s=null==t.width?n-a-this.parsePercent(t.x2,n):this.parsePercent(t.width,n);return{x:a,y:o,width:s,height:null==t.height?i-o-this.parsePercent(t.y2,i):this.parsePercent(t.height,i),centerX:a+s/2}},_mapData:function(e){function t(e,t){return"-"===e.value?1:"-"===t.value?-1:t.value-e.value}function n(e,n){return-t(e,n)}for(var i=this.series[e],a=h.clone(i.data),o=0,s=a.length;s>o;o++)a[o]._index=o;return"none"!=i.sort&&a.sort("descending"===i.sort?t:n),a},_buildItem:function(e,t,n,i,a,o,s,l,h){var m=this.series,V=m[e],U=V.data[t],d=this.getPolygon(e,t,n,i,a,o,s,l,h);r.pack(d,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(d);var p=this.getLabel(e,t,n,i,a,o,s,l,h);r.pack(p,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(p),this._needLabel(V,U,!1)||(p.invisible=!0);var c=this.getLabelLine(e,t,n,i,a,o,s,l,h);this.shapeList.push(c),this._needLabelLine(V,U,!1)||(c.invisible=!0);var u=[],y=[];return this._needLabelLine(V,U,!0)&&(u.push(c.id),y.push(c.id)),this._needLabel(V,U,!0)&&(u.push(p.id),y.push(d.id)),d.hoverConnect=u,p.hoverConnect=y,d},_getItemWidth:function(e,t){var n=this.series[e],i=this._paramsMap[e].location,a=n.min,o=n.max,s=l.parsePercent(n.minSize,i.width),r=l.parsePercent(n.maxSize,i.width);return t*(r-s)/(o-a)},getPolygon:function(e,t,n,i,a,s,r,l,h){var V,U=this.series[e],d=U.data[t],p=[d,U],c=this.deepMerge(p,"itemStyle.normal")||{},u=this.deepMerge(p,"itemStyle.emphasis")||{},y=this.getItemStyleColor(c.color,e,t,d)||n,g=this.getItemStyleColor(u.color,e,t,d)||("string"==typeof y?m.lift(y,-.2):y);switch(h){case"left":V=i;break;case"right":V=i+(s-r);break;default:V=i+(s-r)/2}var b={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(p,"clickable"),style:{pointList:[[i,a],[i+s,a],[V+r,a+l],[V,a+l]],brushType:"both",color:y,lineWidth:c.borderWidth,strokeColor:c.borderColor},highlightStyle:{color:g,lineWidth:u.borderWidth,strokeColor:u.borderColor}};return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(b),b.draggable=!0),new o(b)},getLabel:function(e,t,n,a,o,s,r,l,U){var d,p=this.series[e],c=p.data[t],u=this._paramsMap[e].location,y=h.merge(h.clone(c.itemStyle)||{},p.itemStyle),g="normal",b=y[g].label,f=b.textStyle||{},k=y[g].labelLine.length,x=this.getLabelText(e,t,g),_=this.getFont(f),L=n;b.position=b.position||y.normal.label.position,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(s,r)/2>V.getTextWidth(x,_)?"#fff":m.reverse(n)):d="left"===b.position?"right":"left";var W={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._getLabelPoint(b.position,a,u,s,r,k,U),y:o+l/2,color:f.color||L,text:x,textAlign:f.align||d,textBaseline:f.baseline||"middle",textFont:_}};return g="emphasis",b=y[g].label||b,f=b.textStyle||f,k=y[g].labelLine.length||k,b.position=b.position||y.normal.label.position,x=this.getLabelText(e,t,g),_=this.getFont(f),L=n,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(s,r)/2>V.getTextWidth(x,_)?"#fff":m.reverse(n)):d="left"===b.position?"right":"left",W.highlightStyle={x:this._getLabelPoint(b.position,a,u,s,r,k,U),color:f.color||L,text:x,textAlign:f.align||d,textFont:_,brushType:"fill"},new i(W)},getLabelText:function(e,t,n){var i=this.series,a=i[e],o=a.data[t],s=this.deepQuery([o,a],"itemStyle."+n+".label.formatter");return s?"function"==typeof s?s.call(this.myChart,{seriesIndex:e,seriesName:a.name||"",series:a,dataIndex:t,data:o,name:o.name,value:o.value}):"string"==typeof s?s=s.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{a0}",a.name).replace("{b0}",o.name).replace("{c0}",o.value):void 0:o.name},getLabelLine:function(e,t,n,i,o,s,r,l,m){var V=this.series[e],U=V.data[t],d=this._paramsMap[e].location,p=h.merge(h.clone(U.itemStyle)||{},V.itemStyle),c="normal",u=p[c].labelLine,y=p[c].labelLine.length,g=u.lineStyle||{},b=p[c].label;b.position=b.position||p.normal.label.position;var f={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:this._getLabelLineStartPoint(i,d,s,r,m),yStart:o+l/2,xEnd:this._getLabelPoint(b.position,i,d,s,r,y,m),yEnd:o+l/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return c="emphasis",u=p[c].labelLine||u,y=p[c].labelLine.length||y,g=u.lineStyle||g,b=p[c].label||b,b.position=b.position,f.highlightStyle={xEnd:this._getLabelPoint(b.position,i,d,s,r,y,m),strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new a(f)},_getLabelPoint:function(e,t,n,i,a,o,s){switch(e="inner"===e||"inside"===e?"center":e){case"center":return"center"==s?t+i/2:"left"==s?t+10:t+i-10;case"left":return"auto"===o?n.x-10:"center"==s?n.centerX-Math.max(i,a)/2-o:"right"==s?t-(a>i?a-i:0)-o:n.x-o;default:return"auto"===o?n.x+n.width+10:"center"==s?n.centerX+Math.max(i,a)/2+o:"right"==s?n.x+n.width+o:t+Math.max(i,a)+o}},_getLabelLineStartPoint:function(e,t,n,i,a){return"center"==a?t.centerX:i>n?e+Math.min(n,i)/2:e+Math.max(n,i)/2},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(t,n),e("../chart").define("funnel",t),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/dist/chart/gauge.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/gauge",["require","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("../util/shape/GaugePointer"),a=e("zrender/shape/Text"),o=e("zrender/shape/Line"),s=e("zrender/shape/Rectangle"),r=e("zrender/shape/Circle"),l=e("zrender/shape/Sector"),h=e("../config");h.gauge={zlevel:0,z:2,center:["50%","50%"],clickable:!0,legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}};var m=e("../util/ecData"),V=e("../util/accMath"),U=e("zrender/tool/util");return t.prototype={type:h.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;n>t;t++)e[t].type===h.CHART_TYPE_GAUGE&&(e[t]=this.reformOption(e[t]),this.legendHoverLink=e[t].legendHoverLink||this.legendHoverLink,this._buildSingleGauge(t),this.buildMark(t));this.addShapeList()},_buildSingleGauge:function(e){var t=this.series[e];this._paramsMap[e]={center:this.parseCenter(this.zr,t.center),radius:this.parseRadius(this.zr,t.radius),startAngle:t.startAngle.toFixed(2)-0,endAngle:t.endAngle.toFixed(2)-0},this._paramsMap[e].totalAngle=this._paramsMap[e].startAngle-this._paramsMap[e].endAngle,this._colorMap(e),this._buildAxisLine(e),this._buildSplitLine(e),this._buildAxisTick(e),this._buildAxisLabel(e),this._buildPointer(e),this._buildTitle(e),this._buildDetail(e)},_buildAxisLine:function(e){var t=this.series[e];if(t.axisLine.show)for(var n,i,a=t.min,o=t.max-a,s=this._paramsMap[e],r=s.center,l=s.startAngle,h=s.totalAngle,V=s.colorArray,U=t.axisLine.lineStyle,d=this.parsePercent(U.width,s.radius[1]),p=s.radius[1],c=p-d,u=l,y=0,g=V.length;g>y;y++)i=l-h*(V[y][0]-a)/o,n=this._getSector(r,c,p,i,u,V[y][1],U),u=i,n._animationAdd="r",m.set(n,"seriesIndex",e),m.set(n,"dataIndex",y),this.shapeList.push(n)},_buildSplitLine:function(e){var t=this.series[e];if(t.splitLine.show)for(var n,i,a,s=this._paramsMap[e],r=t.splitNumber,l=t.min,h=t.max-l,m=t.splitLine,V=this.parsePercent(m.length,s.radius[1]),U=m.lineStyle,d=U.color,p=s.center,c=s.startAngle*Math.PI/180,u=s.totalAngle*Math.PI/180,y=s.radius[1],g=y-V,b=0;r>=b;b++)n=c-u/r*b,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:p[0]+a*y,yStart:p[1]-i*y,xEnd:p[0]+a*g,yEnd:p[1]-i*g,strokeColor:"auto"===d?this._getColor(e,l+h/r*b):d,lineType:U.type,lineWidth:U.width,shadowColor:U.shadowColor,shadowBlur:U.shadowBlur,shadowOffsetX:U.shadowOffsetX,shadowOffsetY:U.shadowOffsetY}}))},_buildAxisTick:function(e){var t=this.series[e];if(t.axisTick.show)for(var n,i,a,s=this._paramsMap[e],r=t.splitNumber,l=t.min,h=t.max-l,m=t.axisTick,V=m.splitNumber,U=this.parsePercent(m.length,s.radius[1]),d=m.lineStyle,p=d.color,c=s.center,u=s.startAngle*Math.PI/180,y=s.totalAngle*Math.PI/180,g=s.radius[1],b=g-U,f=0,k=r*V;k>=f;f++)f%V!==0&&(n=u-y/k*f,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:c[0]+a*g,yStart:c[1]-i*g,xEnd:c[0]+a*b,yEnd:c[1]-i*b,strokeColor:"auto"===p?this._getColor(e,l+h/k*f):p,lineType:d.type,lineWidth:d.width,shadowColor:d.shadowColor,shadowBlur:d.shadowBlur,shadowOffsetX:d.shadowOffsetX,shadowOffsetY:d.shadowOffsetY}})))},_buildAxisLabel:function(e){var t=this.series[e];if(t.axisLabel.show)for(var n,i,o,s,r=t.splitNumber,l=t.min,h=t.max-l,m=t.axisLabel.textStyle,U=this.getFont(m),d=m.color,p=this._paramsMap[e],c=p.center,u=p.startAngle,y=p.totalAngle,g=p.radius[1]-this.parsePercent(t.splitLine.length,p.radius[1])-5,b=0;r>=b;b++)s=V.accAdd(l,V.accMul(V.accDiv(h,r),b)),n=u-y/r*b,i=Math.sin(n*Math.PI/180),o=Math.cos(n*Math.PI/180),n=(n+360)%360,this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{x:c[0]+o*g,y:c[1]-i*g,color:"auto"===d?this._getColor(e,s):d,text:this._getLabelText(t.axisLabel.formatter,s),textAlign:n>=110&&250>=n?"left":70>=n||n>=290?"right":"center",textBaseline:n>=10&&170>=n?"top":n>=190&&350>=n?"bottom":"middle",textFont:U,shadowColor:m.shadowColor,shadowBlur:m.shadowBlur,shadowOffsetX:m.shadowOffsetX,shadowOffsetY:m.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(t.pointer.show){var n=t.max-t.min,a=t.pointer,o=this._paramsMap[e],s=this.parsePercent(a.length,o.radius[1]),l=this.parsePercent(a.width,o.radius[1]),h=o.center,V=this._getValue(e);V=V2?2:l/2,color:"#fff"}});m.pack(p,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,V),this.shapeList.push(p),this.shapeList.push(new r({zlevel:this.getZlevelBase(),z:this.getZBase()+2,hoverable:!1,style:{x:h[0],y:h[1],r:a.width/2.5,color:"#fff"}}))}},_buildTitle:function(e){var t=this.series[e];if(t.title.show){var n=t.data[0],i=null!=n.name?n.name:"";if(""!==i){var o=t.title,s=o.offsetCenter,r=o.textStyle,l=r.color,h=this._paramsMap[e],m=h.center[0]+this.parsePercent(s[0],h.radius[1]),V=h.center[1]+this.parsePercent(s[1],h.radius[1]);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase()+(Math.abs(m-h.center[0])+Math.abs(V-h.center[1])<2*r.fontSize?2:1),hoverable:!1,style:{x:m,y:V,color:"auto"===l?this._getColor(e):l,text:i,textAlign:"center",textFont:this.getFont(r),shadowColor:r.shadowColor,shadowBlur:r.shadowBlur,shadowOffsetX:r.shadowOffsetX,shadowOffsetY:r.shadowOffsetY}}))}}},_buildDetail:function(e){var t=this.series[e];if(t.detail.show){var n=t.detail,i=n.offsetCenter,a=n.backgroundColor,o=n.textStyle,r=o.color,l=this._paramsMap[e],h=this._getValue(e),m=l.center[0]-n.width/2+this.parsePercent(i[0],l.radius[1]),V=l.center[1]+this.parsePercent(i[1],l.radius[1]);this.shapeList.push(new s({zlevel:this.getZlevelBase(),z:this.getZBase()+(Math.abs(m+n.width/2-l.center[0])+Math.abs(V+n.height/2-l.center[1])s;s++)o.push([a[s][0]*i+n,a[s][1]]);this._paramsMap[e].colorArray=o},_getColor:function(e,t){null==t&&(t=this._getValue(e));for(var n=this._paramsMap[e].colorArray,i=0,a=n.length;a>i;i++)if(n[i][0]>=t)return n[i][1];return n[n.length-1][1]},_getSector:function(e,t,n,i,a,o,s){return new l({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:i,endAngle:a,brushType:"fill",color:o,shadowColor:s.shadowColor,shadowBlur:s.shadowBlur,shadowOffsetX:s.shadowOffsetX,shadowOffsetY:s.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if("function"==typeof e)return e.call(this.myChart,t);if("string"==typeof e)return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},U.inherits(t,n),e("../chart").define("gauge",t),t}),define("echarts/util/shape/GaugePointer",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/tool/util");return t.prototype={type:"gauge-pointer",buildPath:function(e,t){var n=t.r,i=t.width,a=t.angle,o=t.x-Math.cos(a)*i*(i>=n/3?1:2),s=t.y+Math.sin(a)*i*(i>=n/3?1:2);a=t.angle-Math.PI/2,e.moveTo(o,s),e.lineTo(t.x+Math.cos(a)*i,t.y-Math.sin(a)*i),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(a)*i,t.y+Math.sin(a)*i),e.lineTo(o,s)},getRect:function(e){if(e.__rect)return e.__rect;var t=2*e.width,n=e.x,i=e.y,a=n+Math.cos(e.angle)*e.r,o=i-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,a)-t,y:Math.min(i,o)-t,width:Math.abs(n-a)+t,height:Math.abs(i-o)+t},e.__rect},isCover:e("./normalIsCover")},i.inherits(t,n),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/dist/chart/k.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/k",["require","./base","../util/shape/Candle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("../util/shape/Candle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.k={zlevel:0,z:2,clickable:!0,hoverable:!0,legendHoverLink:!1,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}};var o=e("../util/ecData"),s=e("zrender/tool/util");return t.prototype={type:a.CHART_TYPE_K,_buildShape:function(){var e=this.series;this.selectedMap={};for(var t,i={top:[],bottom:[]},n=0,o=e.length;o>n;n++)e[n].type===a.CHART_TYPE_K&&(e[n]=this.reformOption(e[n]),this.legendHoverLink=e[n].legendHoverLink||this.legendHoverLink,t=this.component.xAxis.getAxis(e[n].xAxisIndex),t.type===a.COMPONENT_TYPE_AXIS_CATEGORY&&i[t.getPosition()].push(n));for(var s in i)i[s].length>0&&this._buildSinglePosition(s,i[s]);this.addShapeList()},_buildSinglePosition:function(e,t){var i=this._mapData(t),n=i.locationMap,a=i.maxDataLength;if(0!==a&&0!==n.length){this._buildHorizontal(t,a,n);for(var o=0,s=t.length;s>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,i,n=this.series,a=this.component.legend,o=[],s=0,r=0,l=e.length;l>r;r++)t=n[e[r]],i=t.name,this.selectedMap[i]=a?a.isSelected(i):!0,this.selectedMap[i]&&o.push(e[r]),s=Math.max(s,t.data.length);return{locationMap:o,maxDataLength:s}},_buildHorizontal:function(e,t,i){for(var n,a,o,s,r,l,h,d,m,c,p=this.series,u={},V=0,U=i.length;U>V;V++){n=i[V],a=p[n],o=a.xAxisIndex||0,s=this.component.xAxis.getAxis(o),h=a.barWidth||Math.floor(s.getGap()/2),c=a.barMaxWidth,c&&h>c&&(h=c),r=a.yAxisIndex||0,l=this.component.yAxis.getAxis(r),u[n]=[];for(var g=0,y=t;y>g&&null!=s.getNameByIndex(g);g++)d=a.data[g],m=this.getDataFromOption(d,"-"),"-"!==m&&4==m.length&&u[n].push([s.getCoordByIndex(g),h,l.getCoord(m[0]),l.getCoord(m[1]),l.getCoord(m[2]),l.getCoord(m[3]),g,s.getNameByIndex(g)])}this._buildKLine(e,u)},_buildKLine:function(e,t){for(var i,n,o,s,r,l,h,d,m,c,p,u,V,U,g,y,f,b=this.series,_=0,x=e.length;x>_;_++)if(f=e[_],p=b[f],U=t[f],this._isLarge(U)&&(U=this._getLargePointList(U)),p.type===a.CHART_TYPE_K&&null!=U){u=p,i=this.query(u,"itemStyle.normal.lineStyle.width"),n=this.query(u,"itemStyle.normal.lineStyle.color"),o=this.query(u,"itemStyle.normal.lineStyle.color0"),s=this.query(u,"itemStyle.normal.color"),r=this.query(u,"itemStyle.normal.color0"),l=this.query(u,"itemStyle.emphasis.lineStyle.width"),h=this.query(u,"itemStyle.emphasis.lineStyle.color"),d=this.query(u,"itemStyle.emphasis.lineStyle.color0"),m=this.query(u,"itemStyle.emphasis.color"),c=this.query(u,"itemStyle.emphasis.color0");for(var k=0,L=U.length;L>k;k++)g=U[k],V=p.data[g[6]],u=V,y=g[3]a;a++)n[a]=e[Math.floor(i/t*a)];return n},_getCandle:function(e,t,i,a,s,r,l,h,d,m,c,p,u,V,U){var g=this.series,y={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery([g[e].data[t],g[e]],"clickable"),hoverable:this.deepQuery([g[e].data[t],g[e]],"hoverable"),style:{x:a,y:[r,l,h,d],width:s,color:m,strokeColor:p,lineWidth:c,brushType:"both"},highlightStyle:{color:u,strokeColor:U,lineWidth:V},_seriesIndex:e};return o.pack(y,g[e],e,g[e].data[t],t,i),y=new n(y)},getMarkCoord:function(e,t){var i=this.series[e],n=this.component.xAxis.getAxis(i.xAxisIndex),a=this.component.yAxis.getAxis(i.yAxisIndex);return["string"!=typeof t.xAxis&&n.getCoordByIndex?n.getCoordByIndex(t.xAxis||0):n.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&a.getCoordByIndex?a.getCoordByIndex(t.yAxis||0):a.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var s,r,l,h,d,m,n=0,a=this.shapeList.length;a>n;n++)if(d=this.shapeList[n]._seriesIndex,i[d]&&!i[d][3]&&"candle"===this.shapeList[n].type){if(m=o.get(this.shapeList[n],"dataIndex"),h=t[d],i[d][2]&&m===h.data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[d][2]&&0===m){this.zr.delShape(this.shapeList[n].id);continue}r=this.component.xAxis.getAxis(h.xAxisIndex||0).getGap(),s=i[d][2]?r:-r,l=0,this.zr.animate(this.shapeList[n].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[s,l]}).start()}}},s.inherits(t,i),e("../chart").define("k",t),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/dist/chart/line.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/line",["require","./base","zrender/shape/Polyline","../util/shape/Icon","../util/shape/HalfSmoothPolygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}function i(e,t,i){var n=t.x,a=t.y,r=t.width,s=t.height,l=s/2;t.symbol.match("empty")&&(e.fillStyle="#fff"),t.brushType="both";var h=t.symbol.replace("empty","").toLowerCase();h.match("star")?(l=h.replace("star","")-0||5,a-=1,h="star"):("rectangle"===h||"arrow"===h)&&(n+=(r-s)/2,r=s);var m="";if(h.match("image")&&(m=h.replace(new RegExp("^image:\\/\\/"),""),h="image",n+=Math.round((r-s)/2)-1,r=s+=2),h=o.prototype.iconLibrary[h]){var d=t.x,c=t.y;e.moveTo(d,c+l),e.lineTo(d+5,c+l),e.moveTo(d+t.width-5,c+l),e.lineTo(d+t.width,c+l);var p=this;h(e,{x:n+4,y:a+4,width:r-8,height:s-8,n:l,image:m},function(){p.modSelf(),i()})}else e.moveTo(n,a+l),e.lineTo(n+r,a+l)}var n=e("./base"),a=e("zrender/shape/Polyline"),o=e("../util/shape/Icon"),r=e("../util/shape/HalfSmoothPolygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var s=e("../config");s.line={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1};var l=e("../util/ecData"),h=e("zrender/tool/util"),m=e("zrender/tool/color");return t.prototype={type:s.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={},this._buildPosition()},_buildHorizontal:function(e,t,i,n){for(var a,o,r,s,l,h,m,d,c,p=this.series,u=i[0][0],V=p[u],U=this.component.xAxis.getAxis(V.xAxisIndex||0),g={},y=0,f=t;f>y&&null!=U.getNameByIndex(y);y++){o=U.getCoordByIndex(y);for(var b=0,_=i.length;_>b;b++){a=this.component.yAxis.getAxis(p[i[b][0]].yAxisIndex||0),l=s=m=h=a.getCoord(0);for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),g[u]=g[u]||[],n[u]=n[u]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==c?(c>=0?(s-=x>0?a.getCoordSize(c):l-a.getCoord(c),r=s):0>c&&(h+=x>0?a.getCoordSize(c):a.getCoord(c)-m,r=h),g[u].push([o,r,y,U.getNameByIndex(y),o,l]),n[u].min>c&&(n[u].min=c,n[u].minY=r,n[u].minX=o),n[u].max0&&(this.finalPLMap[u]=this.finalPLMap[u]||[],this.finalPLMap[u].push(g[u]),g[u]=[])}s=this.component.grid.getY();for(var L,b=0,_=i.length;_>b;b++)for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),"-"==c&&this.deepQuery([d,V,this.option],"calculable")&&(L=this.deepQuery([d,V],"symbolSize"),s+=2*L+5,r=s,this.shapeList.push(this._getCalculableItem(u,y,U.getNameByIndex(y),o,r,"horizontal")))}for(var v in g)g[v].length>0&&(this.finalPLMap[v]=this.finalPLMap[v]||[],this.finalPLMap[v].push(g[v]),g[v]=[]);this._calculMarkMapXY(n,i,"y"),this._buildBorkenLine(e,this.finalPLMap,U,"horizontal")},_buildVertical:function(e,t,i,n){for(var a,o,r,s,l,h,m,d,c,p=this.series,u=i[0][0],V=p[u],U=this.component.yAxis.getAxis(V.yAxisIndex||0),g={},y=0,f=t;f>y&&null!=U.getNameByIndex(y);y++){r=U.getCoordByIndex(y);for(var b=0,_=i.length;_>b;b++){a=this.component.xAxis.getAxis(p[i[b][0]].xAxisIndex||0),l=s=m=h=a.getCoord(0);for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),g[u]=g[u]||[],n[u]=n[u]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==c?(c>=0?(s+=x>0?a.getCoordSize(c):a.getCoord(c)-l,o=s):0>c&&(h-=x>0?a.getCoordSize(c):m-a.getCoord(c),o=h),g[u].push([o,r,y,U.getNameByIndex(y),l,r]),n[u].min>c&&(n[u].min=c,n[u].minX=o,n[u].minY=r),n[u].max0&&(this.finalPLMap[u]=this.finalPLMap[u]||[],this.finalPLMap[u].push(g[u]),g[u]=[])}s=this.component.grid.getXend();for(var L,b=0,_=i.length;_>b;b++)for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),"-"==c&&this.deepQuery([d,V,this.option],"calculable")&&(L=this.deepQuery([d,V],"symbolSize"),s-=2*L+5,o=s,this.shapeList.push(this._getCalculableItem(u,y,U.getNameByIndex(y),o,r,"vertical")))}for(var v in g)g[v].length>0&&(this.finalPLMap[v]=this.finalPLMap[v]||[],this.finalPLMap[v].push(g[v]),g[v]=[]);this._calculMarkMapXY(n,i,"x"),this._buildBorkenLine(e,this.finalPLMap,U,"vertical")},_buildOther:function(e,t,i,n){for(var a,o=this.series,r={},s=0,l=i.length;l>s;s++)for(var h=0,m=i[s].length;m>h;h++){var d=i[s][h],c=o[d];a=this.component.xAxis.getAxis(c.xAxisIndex||0);var p=this.component.yAxis.getAxis(c.yAxisIndex||0),u=p.getCoord(0);r[d]=r[d]||[],n[d]=n[d]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var V=0,U=c.data.length;U>V;V++){var g=c.data[V],y=this.getDataFromOption(g,"-");if(y instanceof Array){var f=a.getCoord(y[0]),b=p.getCoord(y[1]);r[d].push([f,b,V,y[0],f,u]),n[d].min0>y[0]&&(n[d].min0=y[0],n[d].minY0=b,n[d].minX0=f),n[d].max0y[1]&&(n[d].min1=y[1],n[d].minY1=b,n[d].minX1=f),n[d].max10&&(this.finalPLMap[_]=this.finalPLMap[_]||[],this.finalPLMap[_].push(r[_]),r[_]=[]);this._calculMarkMapXY(n,i,"xy"),this._buildBorkenLine(e,this.finalPLMap,a,"other")},_buildBorkenLine:function(e,t,i,n){for(var o,s="other"==n?"horizontal":n,d=this.series,c=e.length-1;c>=0;c--){var p=e[c],u=d[p],V=t[p];if(u.type===this.type&&null!=V)for(var U=this._getBbox(p,s),g=this._sIndex2ColorMap[p],y=this.query(u,"itemStyle.normal.lineStyle.width"),f=this.query(u,"itemStyle.normal.lineStyle.type"),b=this.query(u,"itemStyle.normal.lineStyle.color"),_=this.getItemStyleColor(this.query(u,"itemStyle.normal.color"),p,-1),x=null!=this.query(u,"itemStyle.normal.areaStyle"),k=this.query(u,"itemStyle.normal.areaStyle.color"),L=0,v=V.length;v>L;L++){var W=V[L],w="other"!=n&&this._isLarge(s,W);if(w)W=this._getLargePointList(s,W);else for(var X=0,I=W.length;I>X;X++)o=u.data[W[X][2]],(this.deepQuery([o,u,this.option],"calculable")||this.deepQuery([o,u],"showAllSymbol")||"categoryAxis"===i.type&&i.isMainAxis(W[X][2])&&"none"!=this.deepQuery([o,u],"symbol"))&&this.shapeList.push(this._getSymbol(p,W[X][2],W[X][3],W[X][0],W[X][1],s));var K=new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:y,pointList:W,strokeColor:b||_||g,lineWidth:y,lineType:f,smooth:this._getSmooth(u.smooth),smoothConstraint:U,shadowColor:this.query(u,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(u,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(u,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(u,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:p,_orient:s});if(l.pack(K,d[p],p,0,L,d[p].name),this.shapeList.push(K),x){var S=new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:y,pointList:h.clone(W).concat([[W[W.length-1][4],W[W.length-1][5]],[W[0][4],W[0][5]]]),brushType:"fill",smooth:this._getSmooth(u.smooth),smoothConstraint:U,color:k?k:m.alpha(g,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:p,_orient:s});l.pack(S,d[p],p,0,L,d[p].name),this.shapeList.push(S)}}}},_getBbox:function(e,t){var i=this.component.grid.getBbox(),n=this.xMarkMap[e];return null!=n.minX0?[[Math.min(n.minX0,n.maxX0,n.minX1,n.maxX1),Math.min(n.minY0,n.maxY0,n.minY1,n.maxY1)],[Math.max(n.minX0,n.maxX0,n.minX1,n.maxX1),Math.max(n.minY0,n.maxY0,n.minY1,n.maxY1)]]:("horizontal"===t?(i[0][1]=Math.min(n.minY,n.maxY),i[1][1]=Math.max(n.minY,n.maxY)):(i[0][0]=Math.min(n.minX,n.maxX),i[1][0]=Math.max(n.minX,n.maxX)),i)},_isLarge:function(e,t){return t.length<2?!1:"horizontal"===e?Math.abs(t[0][0]-t[1][0])<.5:Math.abs(t[0][1]-t[1][1])<.5},_getLargePointList:function(e,t){var i;i="horizontal"===e?this.component.grid.getWidth():this.component.grid.getHeight();for(var n=t.length,a=[],o=0;i>o;o++)a[o]=t[Math.floor(n/i*o)];return a},_getSmooth:function(e){return e?.3:0},_getCalculableItem:function(e,t,i,n,a,o){var r=this.series,l=r[e].calculableHolderColor||this.ecTheme.calculableHolderColor||s.calculableHolderColor,h=this._getSymbol(e,t,i,n,a,o);return h.style.color=l,h.style.strokeColor=l,h.rotation=[0,0],h.hoverable=!1,h.draggable=!1,h.style.text=void 0,h},_getSymbol:function(e,t,i,n,a,o){var r=this.series,s=r[e],l=s.data[t],h=this.getSymbolShape(s,e,l,t,i,n,a,this._sIndex2ShapeMap[e],this._sIndex2ColorMap[e],"#fff","vertical"===o?"horizontal":"vertical");return h.zlevel=this.getZlevelBase(),h.z=this.getZBase()+1,this.deepQuery([l,s,this.option],"calculable")&&(this.setCalculable(h),h.draggable=!0),h},getMarkCoord:function(e,t){var i=this.series[e],n=this.xMarkMap[e],a=this.component.xAxis.getAxis(i.xAxisIndex),o=this.component.yAxis.getAxis(i.yAxisIndex);if(t.type&&("max"===t.type||"min"===t.type||"average"===t.type)){var r=null!=t.valueIndex?t.valueIndex:null!=n.maxX0?"1":"";return[n[t.type+"X"+r],n[t.type+"Y"+r],n[t.type+"Line"+r],n[t.type+r]]}return["string"!=typeof t.xAxis&&a.getCoordByIndex?a.getCoordByIndex(t.xAxis||0):a.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&o.getCoordByIndex?o.getCoordByIndex(t.yAxis||0):o.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ontooltipHover:function(e,t){for(var i,n,a=e.seriesIndex,o=e.dataIndex,r=a.length;r--;)if(i=this.finalPLMap[a[r]])for(var s=0,l=i.length;l>s;s++){n=i[s];for(var h=0,m=n.length;m>h;h++)o===n[h][2]&&t.push(this._getSymbol(a[r],n[h][2],n[h][3],n[h][0],n[h][1],"horizontal"))}},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var o,r,s,l,h,m,d,n=this.shapeList.length-1;n>=0;n--)if(h=this.shapeList[n]._seriesIndex,i[h]&&!i[h][3]){if(this.shapeList[n]._main&&this.shapeList[n].style.pointList.length>1){if(m=this.shapeList[n].style.pointList,r=Math.abs(m[0][0]-m[1][0]),l=Math.abs(m[0][1]-m[1][1]),d="horizontal"===this.shapeList[n]._orient,i[h][2]){if("half-smooth-polygon"===this.shapeList[n].type){var c=m.length;this.shapeList[n].style.pointList[c-3]=m[c-2],this.shapeList[n].style.pointList[c-3][d?0:1]=m[c-4][d?0:1],this.shapeList[n].style.pointList[c-2]=m[c-1]}this.shapeList[n].style.pointList.pop(),d?(o=r,s=0):(o=0,s=-l)}else{if(this.shapeList[n].style.pointList.shift(),"half-smooth-polygon"===this.shapeList[n].type){var p=this.shapeList[n].style.pointList.pop();d?p[0]=m[0][0]:p[1]=m[0][1],this.shapeList[n].style.pointList.push(p)}d?(o=-r,s=0):(o=0,s=l)}this.zr.modShape(this.shapeList[n].id,{style:{pointList:this.shapeList[n].style.pointList}},!0)}else{if(i[h][2]&&this.shapeList[n]._dataIndex===t[h].data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[h][2]&&0===this.shapeList[n]._dataIndex){this.zr.delShape(this.shapeList[n].id);continue}}this.shapeList[n].position=[0,0],this.zr.animate(this.shapeList[n].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[o,s]}).start()}}},o.prototype.iconLibrary.legendLineIcon=i,h.inherits(t,n),e("../chart").define("line",t),t}),define("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),a=e("zrender/tool/util");return t.prototype={type:"half-smooth-polygon",buildPath:function(t,i){var a=i.pointList;if(!(a.length<2))if(i.smooth){var o=n(a.slice(0,-2),i.smooth,!1,i.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var r,s,l,h=a.length,m=0;h-3>m;m++)r=o[2*m],s=o[2*m+1],l=a[m+1],t.bezierCurveTo(r[0],r[1],s[0],s[1],l[0],l[1]);t.lineTo(a[h-2][0],a[h-2][1]),t.lineTo(a[h-1][0],a[h-1][1]),t.lineTo(a[0][0],a[0][1])}else e("zrender/shape/Polygon").prototype.buildPath(t,i)}},a.inherits(t,i),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/dist/chart/pie.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/pie",["require","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/Polyline","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o);var s=this;s.shapeHandler.onmouseover=function(e){var t=e.target,i=h.get(t,"seriesIndex"),n=h.get(t,"dataIndex"),a=h.get(t,"special"),o=[t.style.x,t.style.y],r=t.style.startAngle,l=t.style.endAngle,d=((l+r)/2+360)%360,m=t.highlightStyle.color,c=s.getLabel(i,n,a,o,d,m,!0);c&&s.zr.addHoverShape(c);var p=s.getLabelLine(i,n,o,t.style.r0,t.style.r,d,m,!0);p&&s.zr.addHoverShape(p)},this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Ring"),o=e("zrender/shape/Circle"),s=e("zrender/shape/Sector"),r=e("zrender/shape/Polyline"),l=e("../config");l.pie={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}};var h=e("../util/ecData"),d=e("zrender/tool/util"),m=e("zrender/tool/math"),c=e("zrender/tool/color");return t.prototype={type:l.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var i,n,s;this._selectedMode=!1;for(var r,d=0,m=e.length;m>d;d++)if(e[d].type===l.CHART_TYPE_PIE){if(e[d]=this.reformOption(e[d]),this.legendHoverLink=e[d].legendHoverLink||this.legendHoverLink,r=e[d].name||"",this.selectedMap[r]=t?t.isSelected(r):!0,!this.selectedMap[r])continue;i=this.parseCenter(this.zr,e[d].center),n=this.parseRadius(this.zr,e[d].radius),this._selectedMode=this._selectedMode||e[d].selectedMode,this._selected[d]=[],this.deepQuery([e[d],this.option],"calculable")&&(s={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:i[0],y:i[1],r0:n[0]<=10?0:n[0]-10,r:n[1]+10,brushType:"stroke",lineWidth:1,strokeColor:e[d].calculableHolderColor||this.ecTheme.calculableHolderColor||l.calculableHolderColor}},h.pack(s,e[d],d,void 0,-1),this.setCalculable(s),s=n[0]<=10?new o(s):new a(s),this.shapeList.push(s)),this._buildSinglePie(d),this.buildMark(d)}this.addShapeList()},_buildSinglePie:function(e){for(var t,i=this.series,n=i[e],a=n.data,o=this.component.legend,s=0,r=0,l=0,h=Number.NEGATIVE_INFINITY,d=[],m=0,c=a.length;c>m;m++)t=a[m].name,this.selectedMap[t]=o?o.isSelected(t):!0,this.selectedMap[t]&&!isNaN(a[m].value)&&(0!==+a[m].value?s++:r++,l+=+a[m].value,h=Math.max(h,+a[m].value));if(0!==l){for(var p,u,V,g,U,y,f=100,b=n.clockWise,_=(n.startAngle.toFixed(2)-0+360)%360,x=n.minAngle||.01,k=360-x*s-.01*r,L=n.roseType,m=0,c=a.length;c>m;m++)if(t=a[m].name,this.selectedMap[t]&&!isNaN(a[m].value)){if(u=o?o.getColor(t):this.zr.getColor(m),f=a[m].value/l,p="area"!=L?b?_-f*k-(0!==f?x:.01):f*k+_+(0!==f?x:.01):b?_-360/c:360/c+_,p=p.toFixed(2)-0,f=(100*f).toFixed(2),V=this.parseCenter(this.zr,n.center),g=this.parseRadius(this.zr,n.radius),U=+g[0],y=+g[1],"radius"===L?y=a[m].value/h*(y-U)*.8+.2*(y-U)+U:"area"===L&&(y=Math.sqrt(a[m].value/h)*(y-U)+U),b){var v;v=_,_=p,p=v}this._buildItem(d,e,m,f,a[m].selected,V,U,y,_,p,u),b||(_=p)}this._autoLabelLayout(d,V,y);for(var m=0,c=d.length;c>m;m++)this.shapeList.push(d[m]);d=null}},_buildItem:function(e,t,i,n,a,o,s,r,l,d,m){var c=this.series,p=((d+l)/2+360)%360,u=this.getSector(t,i,n,a,o,s,r,l,d,m);h.pack(u,c[t],t,c[t].data[i],i,c[t].data[i].name,n),e.push(u);var V=this.getLabel(t,i,n,o,p,m,!1),g=this.getLabelLine(t,i,o,s,r,p,m,!1);g&&(h.pack(g,c[t],t,c[t].data[i],i,c[t].data[i].name,n),e.push(g)),V&&(h.pack(V,c[t],t,c[t].data[i],i,c[t].data[i].name,n),V._labelLine=g,e.push(V))},getSector:function(e,t,i,n,a,o,r,l,h,d){var p=this.series,u=p[e],V=u.data[t],g=[V,u],U=this.deepMerge(g,"itemStyle.normal")||{},y=this.deepMerge(g,"itemStyle.emphasis")||{},f=this.getItemStyleColor(U.color,e,t,V)||d,b=this.getItemStyleColor(y.color,e,t,V)||("string"==typeof f?c.lift(f,-.2):f),_={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(g,"clickable"),style:{x:a[0],y:a[1],r0:o,r:r,startAngle:l,endAngle:h,brushType:"both",color:f,lineWidth:U.borderWidth,strokeColor:U.borderColor,lineJoin:"round"},highlightStyle:{color:b,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(n){var x=((_.style.startAngle+_.style.endAngle)/2).toFixed(2)-0;_.style._hasSelected=!0,_.style._x=_.style.x,_.style._y=_.style.y;var k=this.query(u,"selectedOffset");_.style.x+=m.cos(x,!0)*k,_.style.y-=m.sin(x,!0)*k,this._selected[e][t]=!0}else this._selected[e][t]=!1;return this._selectedMode&&(_.onclick=this.shapeHandler.onclick),this.deepQuery([V,u,this.option],"calculable")&&(this.setCalculable(_),_.draggable=!0),(this._needLabel(u,V,!0)||this._needLabelLine(u,V,!0))&&(_.onmouseover=this.shapeHandler.onmouseover),_=new s(_)},getLabel:function(e,t,i,a,o,s,r){var l=this.series,h=l[e],c=h.data[t];if(this._needLabel(h,c,r)){var p,u,V,g=r?"emphasis":"normal",U=d.merge(d.clone(c.itemStyle)||{},h.itemStyle),y=U[g].label,f=y.textStyle||{},b=a[0],_=a[1],x=this.parseRadius(this.zr,h.radius),k="middle";y.position=y.position||U.normal.label.position,"center"===y.position?(p=b,u=_,V="center"):"inner"===y.position||"inside"===y.position?(x=(x[0]+x[1])*(y.distance||.5),p=Math.round(b+x*m.cos(o,!0)),u=Math.round(_-x*m.sin(o,!0)),s="#fff",V="center"):(x=x[1]- -U[g].labelLine.length,p=Math.round(b+x*m.cos(o,!0)),u=Math.round(_-x*m.sin(o,!0)),V=o>=90&&270>=o?"right":"left"),"center"!=y.position&&"inner"!=y.position&&"inside"!=y.position&&(p+="left"===V?20:-20),c.__labelX=p-("left"===V?5:-5),c.__labelY=u;var L=new n({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{x:p,y:u,color:f.color||s,text:this.getLabelText(e,t,i,g),textAlign:f.align||V,textBaseline:f.baseline||k,textFont:this.getFont(f)},highlightStyle:{brushType:"fill"}});return L._radius=x,L._labelPosition=y.position||"outer",L._rect=L.getRect(L.style),L._seriesIndex=e,L._dataIndex=t,L}},getLabelText:function(e,t,i,n){var a=this.series,o=a[e],s=o.data[t],r=this.deepQuery([s,o],"itemStyle."+n+".label.formatter");return r?"function"==typeof r?r.call(this.myChart,{seriesIndex:e,seriesName:o.name||"",series:o,dataIndex:t,data:s,name:s.name,value:s.value,percent:i}):"string"==typeof r?(r=r.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),r=r.replace("{a0}",o.name).replace("{b0}",s.name).replace("{c0}",s.value).replace("{d0}",i)):void 0:s.name},getLabelLine:function(e,t,i,n,a,o,s,l){var h=this.series,c=h[e],p=c.data[t];if(this._needLabelLine(c,p,l)){var u=l?"emphasis":"normal",V=d.merge(d.clone(p.itemStyle)||{},c.itemStyle),g=V[u].labelLine,U=g.lineStyle||{},y=i[0],f=i[1],b=a,_=this.parseRadius(this.zr,c.radius)[1]- -g.length,x=m.cos(o,!0),k=m.sin(o,!0);return new r({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{pointList:[[y+b*x,f-b*k],[y+_*x,f-_*k],[p.__labelX,p.__labelY]],strokeColor:U.color||s,lineType:U.type,lineWidth:U.width},_seriesIndex:e,_dataIndex:t})}},_needLabel:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".labelLine.show")},_autoLabelLayout:function(e,t,i){for(var n=[],a=[],o=0,s=e.length;s>o;o++)("outer"===e[o]._labelPosition||"outside"===e[o]._labelPosition)&&(e[o]._rect._y=e[o]._rect.y,e[o]._rect.xa;a++)if(e[a]._rect.y+=n,e[a].style.y+=n,e[a]._labelLine&&(e[a]._labelLine.style.pointList[1][1]+=n,e[a]._labelLine.style.pointList[2][1]+=n),a>t&&i>a+1&&e[a+1]._rect.y>e[a]._rect.y+e[a]._rect.height)return void o(a,n/2);o(i-1,n/2)}function o(t,i){for(var n=t;n>=0&&(e[n]._rect.y-=i,e[n].style.y-=i,e[n]._labelLine&&(e[n]._labelLine.style.pointList[1][1]-=i,e[n]._labelLine.style.pointList[2][1]-=i),!(n>0&&e[n]._rect.y>e[n-1]._rect.y+e[n-1]._rect.height));n--);}function s(e,t,i,n,a){for(var o,s,r,l=i[0],h=i[1],d=a>0?t?Number.MAX_VALUE:0:t?Number.MAX_VALUE:0,m=0,c=e.length;c>m;m++)s=Math.abs(e[m]._rect.y-h),r=e[m]._radius-n,o=n+r>s?Math.sqrt((n+r+20)*(n+r+20)-Math.pow(e[m]._rect.y-h,2)):Math.abs(e[m]._rect.x+(a>0?0:e[m]._rect.width)-l),t&&o>=d&&(o=d-10),!t&&d>=o&&(o=d+10),e[m]._rect.x=e[m].style.x=l+o*a,e[m]._labelLine&&(e[m]._labelLine.style.pointList[2][0]=l+(o-5)*a,e[m]._labelLine.style.pointList[1][0]=l+(o-20)*a),d=o}e.sort(function(e,t){return e._rect.y-t._rect.y});for(var r,l=0,h=e.length,d=[],m=[],c=0;h>c;c++)r=e[c]._rect.y-l,0>r&&a(c,h,-r,n),l=e[c]._rect.y+e[c]._rect.height;this.zr.getHeight()-l<0&&o(h-1,l-this.zr.getHeight());for(var c=0;h>c;c++)e[c]._rect.y>=t[1]?m.push(e[c]):d.push(e[c]);s(m,!0,t,i,n),s(d,!1,t,i,n)},reformOption:function(e){var t=d.merge;return e=t(t(e||{},d.clone(this.ecTheme.pie||{})),d.clone(l.pie)),e.itemStyle.normal.label.textStyle=this.getTextStyle(e.itemStyle.normal.label.textStyle),e.itemStyle.emphasis.label.textStyle=this.getTextStyle(e.itemStyle.emphasis.label.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];var o={},s={},r={},h=this.shapeList;this.shapeList=[];for(var d,m,c,p={},n=0,a=e.length;a>n;n++)d=e[n][0],m=e[n][2],c=e[n][3],t[d]&&t[d].type===l.CHART_TYPE_PIE&&(m?(c||(o[d+"_"+t[d].data.length]="delete"),p[d]=1):c?p[d]=0:(o[d+"_-1"]="delete",p[d]=-1),this._buildSinglePie(d));for(var u,V,n=0,a=this.shapeList.length;a>n;n++)switch(d=this.shapeList[n]._seriesIndex,u=this.shapeList[n]._dataIndex,V=d+"_"+u,this.shapeList[n].type){case"sector":o[V]=this.shapeList[n];break;case"text":s[V]=this.shapeList[n];break;case"polyline":r[V]=this.shapeList[n]}this.shapeList=[];for(var g,n=0,a=h.length;a>n;n++)if(d=h[n]._seriesIndex,i[d]){if(u=h[n]._dataIndex+p[d],V=d+"_"+u,g=o[V],!g)continue;if("sector"===h[n].type)"delete"!=g?this.zr.animate(h[n].id,"style").when(400,{startAngle:g.style.startAngle,endAngle:g.style.endAngle}).start():this.zr.animate(h[n].id,"style").when(400,p[d]<0?{startAngle:h[n].style.startAngle}:{endAngle:h[n].style.endAngle}).start();else if("text"===h[n].type||"polyline"===h[n].type)if("delete"===g)this.zr.delShape(h[n].id);else switch(h[n].type){case"text":g=s[V],this.zr.animate(h[n].id,"style").when(400,{x:g.style.x,y:g.style.y}).start();break;case"polyline":g=r[V],this.zr.animate(h[n].id,"style").when(400,{pointList:g.style.pointList}).start()}}this.shapeList=h},onclick:function(e){var t=this.series;if(this.isClick&&e.target){this.isClick=!1;for(var i,n=e.target,a=n.style,o=h.get(n,"seriesIndex"),s=h.get(n,"dataIndex"),r=0,d=this.shapeList.length;d>r;r++)if(this.shapeList[r].id===n.id){if(o=h.get(n,"seriesIndex"),s=h.get(n,"dataIndex"),a._hasSelected)n.style.x=n.style._x,n.style.y=n.style._y,n.style._hasSelected=!1,this._selected[o][s]=!1;else{var c=((a.startAngle+a.endAngle)/2).toFixed(2)-0;n.style._hasSelected=!0,this._selected[o][s]=!0,n.style._x=n.style.x,n.style._y=n.style.y,i=this.query(t[o],"selectedOffset"),n.style.x+=m.cos(c,!0)*i,n.style.y-=m.sin(c,!0)*i}this.zr.modShape(n.id,n)}else this.shapeList[r].style._hasSelected&&"single"===this._selectedMode&&(o=h.get(this.shapeList[r],"seriesIndex"),s=h.get(this.shapeList[r],"dataIndex"),this.shapeList[r].style.x=this.shapeList[r].style._x,this.shapeList[r].style.y=this.shapeList[r].style._y,this.shapeList[r].style._hasSelected=!1,this._selected[o][s]=!1,this.zr.modShape(this.shapeList[r].id,this.shapeList[r]));this.messageCenter.dispatch(l.EVENT.PIE_SELECTED,e.event,{selected:this._selected,target:h.get(n,"name")},this.myChart),this.zr.refreshNextFrame()}}},d.inherits(t,i),e("../chart").define("pie",t),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/dist/chart/radar.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/radar",["require","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Polygon");e("../component/polar");var a=e("../config");a.radar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2};var o=e("../util/ecData"),s=e("zrender/tool/util"),r=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;for(var e,t=this.series,i=this.component.legend,n=0,o=t.length;o>n;n++)t[n].type===a.CHART_TYPE_RADAR&&(this.serie=this.reformOption(t[n]),this.legendHoverLink=t[n].legendHoverLink||this.legendHoverLink,e=this.serie.name||"",this.selectedMap[e]=i?i.isSelected(e):!0,this.selectedMap[e]&&(this._queryTarget=[this.serie,this.option],this.deepQuery(this._queryTarget,"calculable")&&this._addDropBox(n),this._buildSingleRadar(n),this.buildMark(n)));this.addShapeList()},_buildSingleRadar:function(e){for(var t,i,n,a,o=this.component.legend,s=this.serie.data,r=this.deepQuery(this._queryTarget,"calculable"),l=0;ls;s++)n=this.getDataFromOption(t.value[s]),i="-"!=n?o.getVector(e,s,n):!1,i&&a.push(i);return a},_addSymbol:function(e,t,i,n,a){for(var s,r=this.series,l=this.component.polar,h=0,d=e.length;d>h;h++)s=this.getSymbolShape(this.deepMerge([r[n].data[i],r[n]]),n,r[n].data[i].value[h],h,l.getIndicatorText(a,h),e[h][0],e[h][1],this._symbol[this._radarDataCounter%this._symbol.length],t,"#fff","vertical"),s.zlevel=this.getZlevelBase(),s.z=this.getZBase()+1,o.set(s,"data",r[n].data[i]),o.set(s,"value",r[n].data[i].value),o.set(s,"dataIndex",i),o.set(s,"special",h),this.shapeList.push(s)},_addDataShape:function(e,t,i,a,s,l){var h=this.series,d=[i,this.serie],m=this.getItemStyleColor(this.deepQuery(d,"itemStyle.normal.color"),a,s,i),c=this.deepQuery(d,"itemStyle.normal.lineStyle.width"),p=this.deepQuery(d,"itemStyle.normal.lineStyle.type"),u=this.deepQuery(d,"itemStyle.normal.areaStyle.color"),V=this.deepQuery(d,"itemStyle.normal.areaStyle"),g={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:V?"both":"stroke",color:u||m||("string"==typeof t?r.alpha(t,.5):t),strokeColor:m||t,lineWidth:c,lineType:p},highlightStyle:{brushType:this.deepQuery(d,"itemStyle.emphasis.areaStyle")||V?"both":"stroke",color:this.deepQuery(d,"itemStyle.emphasis.areaStyle.color")||u||m||("string"==typeof t?r.alpha(t,.5):t),strokeColor:this.getItemStyleColor(this.deepQuery(d,"itemStyle.emphasis.color"),a,s,i)||m||t,lineWidth:this.deepQuery(d,"itemStyle.emphasis.lineStyle.width")||c,lineType:this.deepQuery(d,"itemStyle.emphasis.lineStyle.type")||p}};o.pack(g,h[a],a,i,s,i.name,this.component.polar.getIndicator(h[a].polarIndex)),l&&(g.draggable=!0,this.setCalculable(g)),g=new n(g),this.shapeList.push(g)},_addDropBox:function(e){var t=this.series,i=this.deepQuery(this._queryTarget,"polarIndex");if(!this._dropBoxList[i]){var n=this.component.polar.getDropBox(i);n.zlevel=this.getZlevelBase(),n.z=this.getZBase(),this.setCalculable(n),o.pack(n,t,e,void 0,-1),this.shapeList.push(n),this._dropBoxList[i]=!0}},ondragend:function(e,t){var i=this.series;if(this.isDragend&&e.target){var n=e.target,a=o.get(n,"seriesIndex"),s=o.get(n,"dataIndex");this.component.legend&&this.component.legend.del(i[a].data[s].name),i[a].data.splice(s,1),t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},ondrop:function(t,i){var n=this.series;if(this.isDrop&&t.target){var a,s,r=t.target,l=t.dragged,h=o.get(r,"seriesIndex"),d=o.get(r,"dataIndex"),m=this.component.legend;if(-1===d)a={value:o.get(l,"value"),name:o.get(l,"name")},n[h].data.push(a),m&&m.add(a.name,l.style.color||l.style.strokeColor);else{var c=e("../util/accMath");a=n[h].data[d],m&&m.del(a.name),a.name+=this.option.nameConnector+o.get(l,"name"),s=o.get(l,"value");for(var p=0;ph;h++)t=d.polar2cartesian(r,o*Math.PI/180+s*h),l.push({vector:[t[1],-t[0]]})},_getRadius:function(){var e=this.polar[this._index];return this.parsePercent(e.radius,Math.min(this.zr.getWidth(),this.zr.getHeight())/2)},_buildSpiderWeb:function(e){var t=this.polar[e],i=t.__ecIndicator,n=t.splitArea,a=t.splitLine,o=this.getCenter(e),s=t.splitNumber,r=a.lineStyle.color,l=a.lineStyle.width,h=a.show,d=this.deepQuery(this._queryTarget,"axisLine");this._addArea(i,s,o,n,r,l,h),d.show&&this._addLine(i,o,d)},_addAxisLabel:function(t){for(var i,a,o,s,a,r,l,d,m,c,p=e("../util/accMath"),u=this.polar[t],V=this.deepQuery(this._queryTarget,"indicator"),g=u.__ecIndicator,U=this.deepQuery(this._queryTarget,"splitNumber"),y=this.getCenter(t),f=0;f=b;b+=c+1)s=h.merge({},o),l=p.accAdd(r.min,p.accMul(r.step,b)),s.text=this.numAddCommas(l),s.x=b*a[0]/U+Math.cos(d)*m+y[0],s.y=b*a[1]/U+Math.sin(d)*m+y[1],this.shapeList.push(new n({zlevel:this.getZlevelBase(),z:this.getZBase(),style:s,draggable:!1,hoverable:!1}))}},_buildText:function(e){for(var t,i,a,o,s,r,l,h=this.polar[e],d=h.__ecIndicator,m=this.deepQuery(this._queryTarget,"indicator"),c=this.getCenter(e),p=0,u=0,V=0;V0?"left":Math.round(t[0])<0?"right":"center",null==o.margin?t=this._mapVector(t,c,1.1):(r=o.margin,p=t[0]>0?r:-r,u=t[1]>0?r:-r,p=0===t[0]?0:p,u=0===t[1]?0:u,t=this._mapVector(t,c,1)),i.textAlign=a,i.x=t[0]+p,i.y=t[1]+u,s=o.rotate?[o.rotate/180*Math.PI,t[0],t[1]]:[0,0,0],this.shapeList.push(new n({zlevel:this.getZlevelBase(),z:this.getZBase(),style:i,draggable:!1,hoverable:!1,rotation:s})))},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var t,i,e=e||0,n=this.polar[e],a=this.getCenter(e),o=n.__ecIndicator,s=o.length,r=[],l=n.type;if("polygon"==l){for(var h=0;s>h;h++)t=o[h].vector,r.push(this._mapVector(t,a,1.2));i=this._getShape(r,"fill","rgba(0,0,0,0)","",1)}else"circle"==l&&(i=this._getCircle("",1,1.2,a,"fill","rgba(0,0,0,0)"));return i},_addArea:function(e,t,i,n,a,o,s){for(var r,l,h,d,m=this.deepQuery(this._queryTarget,"type"),c=0;t>c;c++)l=(t-c)/t,s&&("polygon"==m?(d=this._getPointList(e,l,i),r=this._getShape(d,"stroke","",a,o)):"circle"==m&&(r=this._getCircle(a,o,l,i,"stroke")),this.shapeList.push(r)),n.show&&(h=(t-c-1)/t,this._addSplitArea(e,n,l,h,i,c))},_getCircle:function(e,t,i,n,a,o){var r=this._getRadius();return new s({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n[0],y:n[1],r:r*i,brushType:a,strokeColor:e,lineWidth:t,color:o},hoverable:!1,draggable:!1})},_getRing:function(e,t,i,n){var a=this._getRadius();return new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n[0],y:n[1],r:t*a,r0:i*a,color:e,brushType:"fill"},hoverable:!1,draggable:!1})},_getPointList:function(e,t,i){for(var n,a=[],o=e.length,s=0;o>s;s++)n=e[s].vector,a.push(this._mapVector(n,i,t));return a},_getShape:function(e,t,i,n,a){return new o({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:t,color:i,strokeColor:n,lineWidth:a},hoverable:!1,draggable:!1})},_addSplitArea:function(e,t,i,n,a,o){var s,r,l,h,d,m=e.length,c=t.areaStyle.color,p=[],m=e.length,u=this.deepQuery(this._queryTarget,"type");if("string"==typeof c&&(c=[c]),r=c.length,s=c[o%r],"polygon"==u)for(var V=0;m>V;V++)p=[],l=e[V].vector,h=e[(V+1)%m].vector,p.push(this._mapVector(l,a,i)),p.push(this._mapVector(l,a,n)),p.push(this._mapVector(h,a,n)),p.push(this._mapVector(h,a,i)),d=this._getShape(p,"fill",s,"",1),this.shapeList.push(d);else"circle"==u&&(d=this._getRing(s,i,n,a),this.shapeList.push(d))},_mapVector:function(e,t,i){return[e[0]*i+t[0],e[1]*i+t[1]]},getCenter:function(e){var e=e||0;return this.parseCenter(this.zr,this.polar[e].center)},_addLine:function(e,t,i){for(var n,a,o=e.length,s=i.lineStyle,r=s.color,l=s.width,h=s.type,d=0;o>d;d++)a=e[d].vector,n=this._getLine(t[0],t[1],a[0]+t[0],a[1]+t[1],r,l,h),this.shapeList.push(n)},_getLine:function(e,t,i,n,o,s,r){return new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:e,yStart:t,xEnd:i,yEnd:n,strokeColor:o,lineWidth:s,lineType:r},hoverable:!1})},_adjustIndicatorValue:function(t){for(var i,n,a=this.polar[t],o=this.deepQuery(this._queryTarget,"indicator"),s=o.length,r=a.__ecIndicator,l=this._getSeriesData(t),h=a.boundaryGap,d=a.splitNumber,m=a.scale,c=e("../util/smartSteps"),p=0;s>p;p++){if("number"==typeof o[p].max)i=o[p].max,n=o[p].min||0;else{var u=this._findValue(l,p,d,h);n=u.min,i=u.max}!m&&n>=0&&i>=0&&(n=0),!m&&0>=n&&0>=i&&(i=0);var V=c(n,i,d);r[p].value={min:V.min,max:V.max,step:V.step}}},_getSeriesData:function(e){for(var t,i,n,a=[],o=this.component.legend,s=0;so||void 0===o)&&(o=e),(s>e||void 0===s)&&(s=e)}var o,s,r;if(e&&0!==e.length){if(1==e.length&&(s=0),1!=e.length)for(var l=0;l0?s=o/i:o/=i),{max:o,min:s}}},getVector:function(e,t,i){e=e||0,t=t||0;var n=this.polar[e].__ecIndicator;if(!(t>=n.length)){var a,o=this.polar[e].__ecIndicator[t],s=this.getCenter(e),r=o.vector,l=o.value.max,h=o.value.min;if("undefined"==typeof i)return s;switch(i){case"min":i=h;break;case"max":i=l;break;case"center":i=(l+h)/2}return a=l!=h?(i-h)/(l-h):.5,this._mapVector(r,s,a)}},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){for(var t,i,n,a,o,s,r,l,h,m=0;ma[0])return{polarIndex:m,valueIndex:Math.floor((h+l/2)/l)%r}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},h.inherits(t,i),e("../component").define("polar",t),t}),define("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function t(e,t){return[e*n.sin(t),e*n.cos(t)]}function i(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var n=e("zrender/tool/math");return{polar2cartesian:t,cartesian2polar:i}}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/echarts/chart/bar.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/bar",["require","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.bar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_BAR,_buildShape:function(){this._buildPosition()},_buildNormal:function(e,t,i,o,r){for(var s,l,h,d,m,c,p,u,V,U,g,y,f=this.series,b=i[0][0],_=f[b],x="horizontal"==r,k=this.component.xAxis,L=this.component.yAxis,v=x?k.getAxis(_.xAxisIndex):L.getAxis(_.yAxisIndex),W=this._mapSize(v,i),w=W.gap,X=W.barGap,I=W.barWidthMap,K=W.barMaxWidthMap,S=W.barWidth,C=W.barMinHeightMap,T=W.interval,E=this.deepQuery([this.ecTheme,a],"island.r"),z=0,A=t;A>z&&null!=v.getNameByIndex(z);z++){x?d=v.getCoordByIndex(z)-w/2:m=v.getCoordByIndex(z)+w/2;for(var M=0,J=i.length;J>M;M++){var F=f[i[M][0]].yAxisIndex||0,O=f[i[M][0]].xAxisIndex||0;s=x?L.getAxis(F):k.getAxis(O),p=c=V=u=s.getCoord(0);for(var P=0,D=i[M].length;D>P;P++)b=i[M][P],_=f[b],g=_.data[z],y=this.getDataFromOption(g,"-"),o[b]=o[b]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},h=Math.min(K[b]||Number.MAX_VALUE,I[b]||S),"-"!==y&&(y>0?(l=P>0?s.getCoordSize(y):x?p-s.getCoord(y):s.getCoord(y)-p,1===D&&C[b]>l&&(l=C[b]),x?(c-=l,m=c):(d=c,c+=l)):0>y?(l=P>0?s.getCoordSize(y):x?s.getCoord(y)-V:V-s.getCoord(y),1===D&&C[b]>l&&(l=C[b]),x?(m=u,u+=l):(u-=l,d=u)):(l=0,x?(c-=l,m=c):(d=c,c+=l)),o[b][z]=x?d+h/2:m-h/2,o[b].min>y&&(o[b].min=y,x?(o[b].minY=m,o[b].minX=o[b][z]):(o[b].minX=d+l,o[b].minY=o[b][z])),o[b].maxP;P++)b=i[M][P],_=f[b],g=_.data[z],y=this.getDataFromOption(g,"-"),h=Math.min(K[b]||Number.MAX_VALUE,I[b]||S),"-"==y&&this.deepQuery([g,_,this.option],"calculable")&&(x?(c-=E,m=c):(d=c,c+=E),U=this._getBarItem(b,z,v.getNameByIndex(z),d,m-(x?0:h),x?h:E,x?E:h,x?"vertical":"horizontal"),U.hoverable=!1,U.draggable=!1,U.style.lineWidth=1,U.style.brushType="stroke",U.style.strokeColor=_.calculableHolderColor||this.ecTheme.calculableHolderColor||a.calculableHolderColor,this.shapeList.push(new n(U)));x?d+=h+X:m-=h+X}}this._calculMarkMapXY(o,i,x?"y":"x")},_buildHorizontal:function(e,t,i,n){return this._buildNormal(e,t,i,n,"horizontal")},_buildVertical:function(e,t,i,n){return this._buildNormal(e,t,i,n,"vertical")},_buildOther:function(e,t,i,a){for(var o=this.series,r=0,s=i.length;s>r;r++)for(var l=0,h=i[r].length;h>l;l++){var d=i[r][l],m=o[d],c=m.xAxisIndex||0,p=this.component.xAxis.getAxis(c),u=p.getCoord(0),V=m.yAxisIndex||0,U=this.component.yAxis.getAxis(V),g=U.getCoord(0);a[d]=a[d]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var y=0,f=m.data.length;f>y;y++){var b=m.data[y],_=this.getDataFromOption(b,"-");if(_ instanceof Array){var x,k,L=p.getCoord(_[0]),v=U.getCoord(_[1]),W=[b,m],w=this.deepQuery(W,"barWidth")||10,X=this.deepQuery(W,"barHeight");null!=X?(x="horizontal",_[0]>0?(w=L-u,L-=w):w=_[0]<0?u-L:0,k=this._getBarItem(d,y,_[0],L,v-X/2,w,X,x)):(x="vertical",_[1]>0?X=g-v:_[1]<0?(X=v-g,v-=X):X=0,k=this._getBarItem(d,y,_[0],L-w/2,v,w,X,x)),this.shapeList.push(new n(k)),L=p.getCoord(_[0]),v=U.getCoord(_[1]),a[d].min0>_[0]&&(a[d].min0=_[0],a[d].minY0=v,a[d].minX0=L),a[d].max0<_[0]&&(a[d].max0=_[0],a[d].maxY0=v,a[d].maxX0=L),a[d].sum0+=_[0],a[d].counter0++,a[d].min1>_[1]&&(a[d].min1=_[1],a[d].minY1=v,a[d].minX1=L),a[d].max1<_[1]&&(a[d].max1=_[1],a[d].maxY1=v,a[d].maxX1=L),a[d].sum1+=_[1],a[d].counter1++}}}this._calculMarkMapXY(a,i,"xy")},_mapSize:function(e,t,i){var n,a,o=this._findSpecialBarSzie(t,i),r=o.barWidthMap,s=o.barMaxWidthMap,l=o.barMinHeightMap,h=o.sBarWidthCounter,d=o.sBarWidthTotal,m=o.barGap,c=o.barCategoryGap,p=1;if(t.length!=h){if(i)n=e.getGap(),m=0,a=+(n/t.length).toFixed(2),0>=a&&(p=Math.floor(t.length/n),a=1);else if(n="string"==typeof c&&c.match(/%$/)?(e.getGap()*(100-parseFloat(c))/100).toFixed(2)-0:e.getGap()-c,"string"==typeof m&&m.match(/%$/)?(m=parseFloat(m)/100,a=+((n-d)/((t.length-1)*m+t.length-h)).toFixed(2),m=a*m):(m=parseFloat(m),a=+((n-d-m*(t.length-1))/(t.length-h)).toFixed(2)),0>=a)return this._mapSize(e,t,!0)}else if(n=h>1?"string"==typeof c&&c.match(/%$/)?+(e.getGap()*(100-parseFloat(c))/100).toFixed(2):e.getGap()-c:d,a=0,m=h>1?+((n-d)/(h-1)).toFixed(2):0,0>m)return this._mapSize(e,t,!0);return this._recheckBarMaxWidth(t,r,s,l,n,a,m,p)},_findSpecialBarSzie:function(e,t){for(var i,n,a,o,r=this.series,s={},l={},h={},d=0,m=0,c=0,p=e.length;p>c;c++)for(var u={barWidth:!1,barMaxWidth:!1},V=0,U=e[c].length;U>V;V++){var g=e[c][V],y=r[g];if(!t){if(u.barWidth)s[g]=i;else if(i=this.query(y,"barWidth"),null!=i){s[g]=i,m+=i,d++,u.barWidth=!0;for(var f=0,b=V;b>f;f++){var _=e[c][f];s[_]=i}}if(u.barMaxWidth)l[g]=n;else if(n=this.query(y,"barMaxWidth"),null!=n){l[g]=n,u.barMaxWidth=!0;for(var f=0,b=V;b>f;f++){var _=e[c][f];l[_]=n}}}h[g]=this.query(y,"barMinHeight"),a=null!=a?a:this.query(y,"barGap"),o=null!=o?o:this.query(y,"barCategoryGap")}return{barWidthMap:s,barMaxWidthMap:l,barMinHeightMap:h,sBarWidth:i,sBarMaxWidth:n,sBarWidthCounter:d,sBarWidthTotal:m,barGap:a,barCategoryGap:o}},_recheckBarMaxWidth:function(e,t,i,n,a,o,r,s){for(var l=0,h=e.length;h>l;l++){var d=e[l][0];i[d]&&i[d]0&&f.height>y&&f.width>y?(f.y+=y/2,f.height-=y,f.x+=y/2,f.width-=y):f.brushType="fill",d.highlightStyle.textColor=d.highlightStyle.color,d=this.addLabel(d,c,p,i,h);var b=f.textPosition;if("insideLeft"===b||"insideRight"===b||"insideTop"===b||"insideBottom"===b){var _=5;switch(b){case"insideLeft":f.textX=f.x+_,f.textY=f.y+f.height/2,f.textAlign="left",f.textBaseline="middle";break;case"insideRight":f.textX=f.x+f.width-_,f.textY=f.y+f.height/2,f.textAlign="right",f.textBaseline="middle";break;case"insideTop":f.textX=f.x+f.width/2,f.textY=f.y+_/2,f.textAlign="center",f.textBaseline="top";break;case"insideBottom":f.textX=f.x+f.width/2,f.textY=f.y+f.height-_/2,f.textAlign="center",f.textBaseline="bottom"}f.textPosition="specific",f.textColor=f.textColor||"#fff"}return this.deepQuery([p,c,this.option],"calculable")&&(this.setCalculable(d),d.draggable=!0),o.pack(d,m[e],e,m[e].data[t],t,i),d},getMarkCoord:function(e,t){var i,n,a=this.series[e],o=this.xMarkMap[e],r=this.component.xAxis.getAxis(a.xAxisIndex),s=this.component.yAxis.getAxis(a.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)if(o.isHorizontal){i="string"==typeof t.xAxis&&r.getIndexByName?r.getIndexByName(t.xAxis):t.xAxis||0;var l=o[i];l=null!=l?l:"string"!=typeof t.xAxis&&r.getCoordByIndex?r.getCoordByIndex(t.xAxis||0):r.getCoord(t.xAxis||0),n=[l,s.getCoord(t.yAxis||0)]}else{i="string"==typeof t.yAxis&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var h=o[i];h=null!=h?h:"string"!=typeof t.yAxis&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),n=[r.getCoord(t.xAxis||0),h]}else{var d=null!=t.valueIndex?t.valueIndex:null!=o.maxX0?"1":"";n=[o[t.type+"X"+d],o[t.type+"Y"+d],o[t.type+"Line"+d],o[t.type+d]]}return n},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var r,s,l,h,d,m,c,n=this.shapeList.length-1;n>=0;n--)if(m=o.get(this.shapeList[n],"seriesIndex"),i[m]&&!i[m][3]&&"rectangle"===this.shapeList[n].type){if(c=o.get(this.shapeList[n],"dataIndex"),d=t[m],i[m][2]&&c===d.data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[m][2]&&0===c){this.zr.delShape(this.shapeList[n].id);continue}"horizontal"===this.shapeList[n]._orient?(h=this.component.yAxis.getAxis(d.yAxisIndex||0).getGap(),l=i[m][2]?-h:h,r=0):(s=this.component.xAxis.getAxis(d.xAxisIndex||0).getGap(),r=i[m][2]?s:-s,l=0),this.shapeList[n].position=[0,0],this.zr.animate(this.shapeList[n].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[r,l]}).start()}}},r.inherits(t,i),e("../chart").define("bar",t),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/echarts/chart/eventRiver.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/eventRiver",["require","./base","../layout/eventRiver","zrender/shape/Polygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","../util/date","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o);var r=this;r._ondragend=function(){r.isDragend=!0},this.refresh(a)}var i=e("./base"),n=e("../layout/eventRiver"),a=e("zrender/shape/Polygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var o=e("../config");o.eventRiver={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"inside",formatter:"{b}"}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0}}}};var r=e("../util/ecData"),s=e("../util/date"),l=e("zrender/tool/util"),h=e("zrender/tool/color");return t.prototype={type:o.CHART_TYPE_EVENTRIVER,_buildShape:function(){var e=this.series;this.selectedMap={},this._dataPreprocessing();for(var t=this.component.legend,i=[],a=0;an;n++)if(i[n].type===this.type){e=this.component.xAxis.getAxis(i[n].xAxisIndex||0);for(var o=0,r=i[n].eventList.length;r>o;o++){t=i[n].eventList[o].evolution;for(var l=0,h=t.length;h>l;l++)t[l].timeScale=e.getCoord(s.getNewDate(t[l].time)-0),t[l].valueScale=Math.pow(t[l].value,.8)}}this._intervalX=Math.round(this.component.grid.getWidth()/40)},_drawEventRiver:function(){for(var e=this.series,t=0;ta)){for(var o=[],r=[],s=0;a>s;s++)o.push(n[s].timeScale),r.push(n[s].valueScale);var l=[];l.push([o[0],i]);var s=0;for(s=0;a-1>s;s++)l.push([(o[s]+o[s+1])/2,r[s]/-2+i]);for(l.push([(o[s]+(o[s]+t))/2,r[s]/-2+i]),l.push([o[s]+t,i]),l.push([(o[s]+(o[s]+t))/2,r[s]/2+i]),s=a-1;s>0;s--)l.push([(o[s]+o[s-1])/2,r[s-1]/2+i]);return l}},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1)},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},l.inherits(t,i),e("../chart").define("eventRiver",t),t}),define("echarts/layout/eventRiver",["require"],function(){function e(e,o,r){function s(e,t){var i=e.importance,n=t.importance;return i>n?-1:n>i?1:0}function l(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;n>i;i++)if(e[i]===t)return i;return-1}for(var h=5,m=o,V=0;Ve+1){var a=Math.round((e+t)/2);n.leftChild=i(e,a),n.rightChild=i(a,t)}return n}function n(e,t,i){if(1>i-t)return 0;var a=Math.round((e.left+e.right)/2),o=0;if(t==e.left&&i==e.right)o=e.maxValue;else if(a>=i&&null!=e.leftChild)o=n(e.leftChild,t,i);else if(t>=a&&null!=e.rightChild)o=n(e.rightChild,t,i);else{var r=0,s=0;null!=e.leftChild&&(r=n(e.leftChild,t,a)),null!=e.rightChild&&(s=n(e.rightChild,a,i)),o=r>s?r:s}return o}function a(e,t,i,n){if(null!=e){var o=Math.round((e.left+e.right)/2);e.maxValue=e.maxValue>n?e.maxValue:n,(Math.floor(10*t)!=Math.floor(10*e.left)||Math.floor(10*i)!=Math.floor(10*e.right))&&(o>=i?a(e.leftChild,t,i,n):t>=o?a(e.rightChild,t,i,n):(a(e.leftChild,t,o,n),a(e.rightChild,o,i,n)))}}return e}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/echarts/chart/funnel.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/funnel",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Polygon"),s=e("../config");s.funnel={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}};var r=e("../util/ecData"),l=e("../util/number"),h=e("zrender/tool/util"),m=e("zrender/tool/color"),V=e("zrender/tool/area");return t.prototype={type:s.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};for(var n,i=0,a=e.length;a>i;i++)if(e[i].type===s.CHART_TYPE_FUNNEL){if(e[i]=this.reformOption(e[i]),this.legendHoverLink=e[i].legendHoverLink||this.legendHoverLink,n=e[i].name||"",this.selectedMap[n]=t?t.isSelected(n):!0,!this.selectedMap[n])continue;this._buildSingleFunnel(i),this.buildMark(i)}this.addShapeList()},_buildSingleFunnel:function(e){var t=this.component.legend,n=this.series[e],i=this._mapData(e),a=this._getLocation(e);this._paramsMap[e]={location:a,data:i};for(var o,s=0,r=[],h=0,m=i.length;m>h;h++)o=i[h].name,this.selectedMap[o]=t?t.isSelected(o):!0,this.selectedMap[o]&&!isNaN(i[h].value)&&(r.push(i[h]),s++);if(0!==s){for(var V,U,d,p,c=this._buildFunnelCase(e),u=n.funnelAlign,y=n.gap,g=s>1?(a.height-(s-1)*y)/s:a.height,b=a.y,f="descending"===n.sort?this._getItemWidth(e,r[0].value):l.parsePercent(n.minSize,a.width),k="descending"===n.sort?1:0,x=a.centerX,_=[],h=0,m=r.length;m>h;h++)if(o=r[h].name,this.selectedMap[o]&&!isNaN(r[h].value)){switch(V=m-2>=h?this._getItemWidth(e,r[h+k].value):"descending"===n.sort?l.parsePercent(n.minSize,a.width):l.parsePercent(n.maxSize,a.width),u){case"left":U=a.x;break;case"right":U=a.x+a.width-f;break;default:U=x-f/2}d=this._buildItem(e,r[h]._index,t?t.getColor(o):this.zr.getColor(r[h]._index),U,b,f,V,g,u),b+=g+y,p=d.style.pointList,_.unshift([p[0][0]-10,p[0][1]]),_.push([p[1][0]+10,p[1][1]]),0===h&&(0===f?(p=_.pop(),"center"==u&&(_[0][0]+=10),"right"==u&&(_[0][0]=p[0]),_[0][1]-="center"==u?10:15,1==m&&(p=d.style.pointList)):(_[_.length-1][1]-=5,_[0][1]-=5)),f=V}c&&(_.unshift([p[3][0]-10,p[3][1]]),_.push([p[2][0]+10,p[2][1]]),0===f?(p=_.pop(),"center"==u&&(_[0][0]+=10),"right"==u&&(_[0][0]=p[0]),_[0][1]+="center"==u?10:15):(_[_.length-1][1]+=5,_[0][1]+=5),c.style.pointList=_)}},_buildFunnelCase:function(e){var t=this.series[e];if(this.deepQuery([t,this.option],"calculable")){var n=this._paramsMap[e].location,i=10,a={hoverable:!1,style:{pointListd:[[n.x-i,n.y-i],[n.x+n.width+i,n.y-i],[n.x+n.width+i,n.y+n.height+i],[n.x-i,n.y+n.height+i]],brushType:"stroke",lineWidth:1,strokeColor:t.calculableHolderColor||this.ecTheme.calculableHolderColor||s.calculableHolderColor}};return r.pack(a,t,e,void 0,-1),this.setCalculable(a),a=new o(a),this.shapeList.push(a),a}},_getLocation:function(e){var t=this.series[e],n=this.zr.getWidth(),i=this.zr.getHeight(),a=this.parsePercent(t.x,n),o=this.parsePercent(t.y,i),s=null==t.width?n-a-this.parsePercent(t.x2,n):this.parsePercent(t.width,n);return{x:a,y:o,width:s,height:null==t.height?i-o-this.parsePercent(t.y2,i):this.parsePercent(t.height,i),centerX:a+s/2}},_mapData:function(e){function t(e,t){return"-"===e.value?1:"-"===t.value?-1:t.value-e.value}function n(e,n){return-t(e,n)}for(var i=this.series[e],a=h.clone(i.data),o=0,s=a.length;s>o;o++)a[o]._index=o;return"none"!=i.sort&&a.sort("descending"===i.sort?t:n),a},_buildItem:function(e,t,n,i,a,o,s,l,h){var m=this.series,V=m[e],U=V.data[t],d=this.getPolygon(e,t,n,i,a,o,s,l,h);r.pack(d,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(d);var p=this.getLabel(e,t,n,i,a,o,s,l,h);r.pack(p,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(p),this._needLabel(V,U,!1)||(p.invisible=!0);var c=this.getLabelLine(e,t,n,i,a,o,s,l,h);this.shapeList.push(c),this._needLabelLine(V,U,!1)||(c.invisible=!0);var u=[],y=[];return this._needLabelLine(V,U,!0)&&(u.push(c.id),y.push(c.id)),this._needLabel(V,U,!0)&&(u.push(p.id),y.push(d.id)),d.hoverConnect=u,p.hoverConnect=y,d},_getItemWidth:function(e,t){var n=this.series[e],i=this._paramsMap[e].location,a=n.min,o=n.max,s=l.parsePercent(n.minSize,i.width),r=l.parsePercent(n.maxSize,i.width);return t*(r-s)/(o-a)},getPolygon:function(e,t,n,i,a,s,r,l,h){var V,U=this.series[e],d=U.data[t],p=[d,U],c=this.deepMerge(p,"itemStyle.normal")||{},u=this.deepMerge(p,"itemStyle.emphasis")||{},y=this.getItemStyleColor(c.color,e,t,d)||n,g=this.getItemStyleColor(u.color,e,t,d)||("string"==typeof y?m.lift(y,-.2):y);switch(h){case"left":V=i;break;case"right":V=i+(s-r);break;default:V=i+(s-r)/2}var b={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(p,"clickable"),style:{pointList:[[i,a],[i+s,a],[V+r,a+l],[V,a+l]],brushType:"both",color:y,lineWidth:c.borderWidth,strokeColor:c.borderColor},highlightStyle:{color:g,lineWidth:u.borderWidth,strokeColor:u.borderColor}};return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(b),b.draggable=!0),new o(b)},getLabel:function(e,t,n,a,o,s,r,l,U){var d,p=this.series[e],c=p.data[t],u=this._paramsMap[e].location,y=h.merge(h.clone(c.itemStyle)||{},p.itemStyle),g="normal",b=y[g].label,f=b.textStyle||{},k=y[g].labelLine.length,x=this.getLabelText(e,t,g),_=this.getFont(f),L=n;b.position=b.position||y.normal.label.position,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(s,r)/2>V.getTextWidth(x,_)?"#fff":m.reverse(n)):d="left"===b.position?"right":"left";var W={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._getLabelPoint(b.position,a,u,s,r,k,U),y:o+l/2,color:f.color||L,text:x,textAlign:f.align||d,textBaseline:f.baseline||"middle",textFont:_}};return g="emphasis",b=y[g].label||b,f=b.textStyle||f,k=y[g].labelLine.length||k,b.position=b.position||y.normal.label.position,x=this.getLabelText(e,t,g),_=this.getFont(f),L=n,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(s,r)/2>V.getTextWidth(x,_)?"#fff":m.reverse(n)):d="left"===b.position?"right":"left",W.highlightStyle={x:this._getLabelPoint(b.position,a,u,s,r,k,U),color:f.color||L,text:x,textAlign:f.align||d,textFont:_,brushType:"fill"},new i(W)},getLabelText:function(e,t,n){var i=this.series,a=i[e],o=a.data[t],s=this.deepQuery([o,a],"itemStyle."+n+".label.formatter");return s?"function"==typeof s?s.call(this.myChart,{seriesIndex:e,seriesName:a.name||"",series:a,dataIndex:t,data:o,name:o.name,value:o.value}):"string"==typeof s?s=s.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{a0}",a.name).replace("{b0}",o.name).replace("{c0}",o.value):void 0:o.name},getLabelLine:function(e,t,n,i,o,s,r,l,m){var V=this.series[e],U=V.data[t],d=this._paramsMap[e].location,p=h.merge(h.clone(U.itemStyle)||{},V.itemStyle),c="normal",u=p[c].labelLine,y=p[c].labelLine.length,g=u.lineStyle||{},b=p[c].label;b.position=b.position||p.normal.label.position;var f={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:this._getLabelLineStartPoint(i,d,s,r,m),yStart:o+l/2,xEnd:this._getLabelPoint(b.position,i,d,s,r,y,m),yEnd:o+l/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return c="emphasis",u=p[c].labelLine||u,y=p[c].labelLine.length||y,g=u.lineStyle||g,b=p[c].label||b,b.position=b.position,f.highlightStyle={xEnd:this._getLabelPoint(b.position,i,d,s,r,y,m),strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new a(f)},_getLabelPoint:function(e,t,n,i,a,o,s){switch(e="inner"===e||"inside"===e?"center":e){case"center":return"center"==s?t+i/2:"left"==s?t+10:t+i-10;case"left":return"auto"===o?n.x-10:"center"==s?n.centerX-Math.max(i,a)/2-o:"right"==s?t-(a>i?a-i:0)-o:n.x-o;default:return"auto"===o?n.x+n.width+10:"center"==s?n.centerX+Math.max(i,a)/2+o:"right"==s?n.x+n.width+o:t+Math.max(i,a)+o}},_getLabelLineStartPoint:function(e,t,n,i,a){return"center"==a?t.centerX:i>n?e+Math.min(n,i)/2:e+Math.max(n,i)/2},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(t,n),e("../chart").define("funnel",t),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/echarts/chart/gauge.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/gauge",["require","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("../util/shape/GaugePointer"),a=e("zrender/shape/Text"),o=e("zrender/shape/Line"),s=e("zrender/shape/Rectangle"),r=e("zrender/shape/Circle"),l=e("zrender/shape/Sector"),h=e("../config");h.gauge={zlevel:0,z:2,center:["50%","50%"],clickable:!0,legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}};var m=e("../util/ecData"),V=e("../util/accMath"),U=e("zrender/tool/util");return t.prototype={type:h.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;n>t;t++)e[t].type===h.CHART_TYPE_GAUGE&&(e[t]=this.reformOption(e[t]),this.legendHoverLink=e[t].legendHoverLink||this.legendHoverLink,this._buildSingleGauge(t),this.buildMark(t));this.addShapeList()},_buildSingleGauge:function(e){var t=this.series[e];this._paramsMap[e]={center:this.parseCenter(this.zr,t.center),radius:this.parseRadius(this.zr,t.radius),startAngle:t.startAngle.toFixed(2)-0,endAngle:t.endAngle.toFixed(2)-0},this._paramsMap[e].totalAngle=this._paramsMap[e].startAngle-this._paramsMap[e].endAngle,this._colorMap(e),this._buildAxisLine(e),this._buildSplitLine(e),this._buildAxisTick(e),this._buildAxisLabel(e),this._buildPointer(e),this._buildTitle(e),this._buildDetail(e)},_buildAxisLine:function(e){var t=this.series[e];if(t.axisLine.show)for(var n,i,a=t.min,o=t.max-a,s=this._paramsMap[e],r=s.center,l=s.startAngle,h=s.totalAngle,V=s.colorArray,U=t.axisLine.lineStyle,d=this.parsePercent(U.width,s.radius[1]),p=s.radius[1],c=p-d,u=l,y=0,g=V.length;g>y;y++)i=l-h*(V[y][0]-a)/o,n=this._getSector(r,c,p,i,u,V[y][1],U),u=i,n._animationAdd="r",m.set(n,"seriesIndex",e),m.set(n,"dataIndex",y),this.shapeList.push(n)},_buildSplitLine:function(e){var t=this.series[e];if(t.splitLine.show)for(var n,i,a,s=this._paramsMap[e],r=t.splitNumber,l=t.min,h=t.max-l,m=t.splitLine,V=this.parsePercent(m.length,s.radius[1]),U=m.lineStyle,d=U.color,p=s.center,c=s.startAngle*Math.PI/180,u=s.totalAngle*Math.PI/180,y=s.radius[1],g=y-V,b=0;r>=b;b++)n=c-u/r*b,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:p[0]+a*y,yStart:p[1]-i*y,xEnd:p[0]+a*g,yEnd:p[1]-i*g,strokeColor:"auto"===d?this._getColor(e,l+h/r*b):d,lineType:U.type,lineWidth:U.width,shadowColor:U.shadowColor,shadowBlur:U.shadowBlur,shadowOffsetX:U.shadowOffsetX,shadowOffsetY:U.shadowOffsetY}}))},_buildAxisTick:function(e){var t=this.series[e];if(t.axisTick.show)for(var n,i,a,s=this._paramsMap[e],r=t.splitNumber,l=t.min,h=t.max-l,m=t.axisTick,V=m.splitNumber,U=this.parsePercent(m.length,s.radius[1]),d=m.lineStyle,p=d.color,c=s.center,u=s.startAngle*Math.PI/180,y=s.totalAngle*Math.PI/180,g=s.radius[1],b=g-U,f=0,k=r*V;k>=f;f++)f%V!==0&&(n=u-y/k*f,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:c[0]+a*g,yStart:c[1]-i*g,xEnd:c[0]+a*b,yEnd:c[1]-i*b,strokeColor:"auto"===p?this._getColor(e,l+h/k*f):p,lineType:d.type,lineWidth:d.width,shadowColor:d.shadowColor,shadowBlur:d.shadowBlur,shadowOffsetX:d.shadowOffsetX,shadowOffsetY:d.shadowOffsetY}})))},_buildAxisLabel:function(e){var t=this.series[e];if(t.axisLabel.show)for(var n,i,o,s,r=t.splitNumber,l=t.min,h=t.max-l,m=t.axisLabel.textStyle,U=this.getFont(m),d=m.color,p=this._paramsMap[e],c=p.center,u=p.startAngle,y=p.totalAngle,g=p.radius[1]-this.parsePercent(t.splitLine.length,p.radius[1])-5,b=0;r>=b;b++)s=V.accAdd(l,V.accMul(V.accDiv(h,r),b)),n=u-y/r*b,i=Math.sin(n*Math.PI/180),o=Math.cos(n*Math.PI/180),n=(n+360)%360,this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{x:c[0]+o*g,y:c[1]-i*g,color:"auto"===d?this._getColor(e,s):d,text:this._getLabelText(t.axisLabel.formatter,s),textAlign:n>=110&&250>=n?"left":70>=n||n>=290?"right":"center",textBaseline:n>=10&&170>=n?"top":n>=190&&350>=n?"bottom":"middle",textFont:U,shadowColor:m.shadowColor,shadowBlur:m.shadowBlur,shadowOffsetX:m.shadowOffsetX,shadowOffsetY:m.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(t.pointer.show){var n=t.max-t.min,a=t.pointer,o=this._paramsMap[e],s=this.parsePercent(a.length,o.radius[1]),l=this.parsePercent(a.width,o.radius[1]),h=o.center,V=this._getValue(e);V=V2?2:l/2,color:"#fff"}});m.pack(p,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,V),this.shapeList.push(p),this.shapeList.push(new r({zlevel:this.getZlevelBase(),z:this.getZBase()+2,hoverable:!1,style:{x:h[0],y:h[1],r:a.width/2.5,color:"#fff"}}))}},_buildTitle:function(e){var t=this.series[e];if(t.title.show){var n=t.data[0],i=null!=n.name?n.name:"";if(""!==i){var o=t.title,s=o.offsetCenter,r=o.textStyle,l=r.color,h=this._paramsMap[e],m=h.center[0]+this.parsePercent(s[0],h.radius[1]),V=h.center[1]+this.parsePercent(s[1],h.radius[1]);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase()+(Math.abs(m-h.center[0])+Math.abs(V-h.center[1])<2*r.fontSize?2:1),hoverable:!1,style:{x:m,y:V,color:"auto"===l?this._getColor(e):l,text:i,textAlign:"center",textFont:this.getFont(r),shadowColor:r.shadowColor,shadowBlur:r.shadowBlur,shadowOffsetX:r.shadowOffsetX,shadowOffsetY:r.shadowOffsetY}}))}}},_buildDetail:function(e){var t=this.series[e];if(t.detail.show){var n=t.detail,i=n.offsetCenter,a=n.backgroundColor,o=n.textStyle,r=o.color,l=this._paramsMap[e],h=this._getValue(e),m=l.center[0]-n.width/2+this.parsePercent(i[0],l.radius[1]),V=l.center[1]+this.parsePercent(i[1],l.radius[1]);this.shapeList.push(new s({zlevel:this.getZlevelBase(),z:this.getZBase()+(Math.abs(m+n.width/2-l.center[0])+Math.abs(V+n.height/2-l.center[1])s;s++)o.push([a[s][0]*i+n,a[s][1]]);this._paramsMap[e].colorArray=o},_getColor:function(e,t){null==t&&(t=this._getValue(e));for(var n=this._paramsMap[e].colorArray,i=0,a=n.length;a>i;i++)if(n[i][0]>=t)return n[i][1];return n[n.length-1][1]},_getSector:function(e,t,n,i,a,o,s){return new l({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:i,endAngle:a,brushType:"fill",color:o,shadowColor:s.shadowColor,shadowBlur:s.shadowBlur,shadowOffsetX:s.shadowOffsetX,shadowOffsetY:s.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if("function"==typeof e)return e.call(this.myChart,t);if("string"==typeof e)return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},U.inherits(t,n),e("../chart").define("gauge",t),t}),define("echarts/util/shape/GaugePointer",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/tool/util");return t.prototype={type:"gauge-pointer",buildPath:function(e,t){var n=t.r,i=t.width,a=t.angle,o=t.x-Math.cos(a)*i*(i>=n/3?1:2),s=t.y+Math.sin(a)*i*(i>=n/3?1:2);a=t.angle-Math.PI/2,e.moveTo(o,s),e.lineTo(t.x+Math.cos(a)*i,t.y-Math.sin(a)*i),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(a)*i,t.y+Math.sin(a)*i),e.lineTo(o,s)},getRect:function(e){if(e.__rect)return e.__rect;var t=2*e.width,n=e.x,i=e.y,a=n+Math.cos(e.angle)*e.r,o=i-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,a)-t,y:Math.min(i,o)-t,width:Math.abs(n-a)+t,height:Math.abs(i-o)+t},e.__rect},isCover:e("./normalIsCover")},i.inherits(t,n),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/echarts/chart/k.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/k",["require","./base","../util/shape/Candle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("../util/shape/Candle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.k={zlevel:0,z:2,clickable:!0,hoverable:!0,legendHoverLink:!1,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}};var o=e("../util/ecData"),s=e("zrender/tool/util");return t.prototype={type:a.CHART_TYPE_K,_buildShape:function(){var e=this.series;this.selectedMap={};for(var t,i={top:[],bottom:[]},n=0,o=e.length;o>n;n++)e[n].type===a.CHART_TYPE_K&&(e[n]=this.reformOption(e[n]),this.legendHoverLink=e[n].legendHoverLink||this.legendHoverLink,t=this.component.xAxis.getAxis(e[n].xAxisIndex),t.type===a.COMPONENT_TYPE_AXIS_CATEGORY&&i[t.getPosition()].push(n));for(var s in i)i[s].length>0&&this._buildSinglePosition(s,i[s]);this.addShapeList()},_buildSinglePosition:function(e,t){var i=this._mapData(t),n=i.locationMap,a=i.maxDataLength;if(0!==a&&0!==n.length){this._buildHorizontal(t,a,n);for(var o=0,s=t.length;s>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,i,n=this.series,a=this.component.legend,o=[],s=0,r=0,l=e.length;l>r;r++)t=n[e[r]],i=t.name,this.selectedMap[i]=a?a.isSelected(i):!0,this.selectedMap[i]&&o.push(e[r]),s=Math.max(s,t.data.length);return{locationMap:o,maxDataLength:s}},_buildHorizontal:function(e,t,i){for(var n,a,o,s,r,l,h,d,m,c,p=this.series,u={},V=0,U=i.length;U>V;V++){n=i[V],a=p[n],o=a.xAxisIndex||0,s=this.component.xAxis.getAxis(o),h=a.barWidth||Math.floor(s.getGap()/2),c=a.barMaxWidth,c&&h>c&&(h=c),r=a.yAxisIndex||0,l=this.component.yAxis.getAxis(r),u[n]=[];for(var g=0,y=t;y>g&&null!=s.getNameByIndex(g);g++)d=a.data[g],m=this.getDataFromOption(d,"-"),"-"!==m&&4==m.length&&u[n].push([s.getCoordByIndex(g),h,l.getCoord(m[0]),l.getCoord(m[1]),l.getCoord(m[2]),l.getCoord(m[3]),g,s.getNameByIndex(g)])}this._buildKLine(e,u)},_buildKLine:function(e,t){for(var i,n,o,s,r,l,h,d,m,c,p,u,V,U,g,y,f,b=this.series,_=0,x=e.length;x>_;_++)if(f=e[_],p=b[f],U=t[f],this._isLarge(U)&&(U=this._getLargePointList(U)),p.type===a.CHART_TYPE_K&&null!=U){u=p,i=this.query(u,"itemStyle.normal.lineStyle.width"),n=this.query(u,"itemStyle.normal.lineStyle.color"),o=this.query(u,"itemStyle.normal.lineStyle.color0"),s=this.query(u,"itemStyle.normal.color"),r=this.query(u,"itemStyle.normal.color0"),l=this.query(u,"itemStyle.emphasis.lineStyle.width"),h=this.query(u,"itemStyle.emphasis.lineStyle.color"),d=this.query(u,"itemStyle.emphasis.lineStyle.color0"),m=this.query(u,"itemStyle.emphasis.color"),c=this.query(u,"itemStyle.emphasis.color0");for(var k=0,L=U.length;L>k;k++)g=U[k],V=p.data[g[6]],u=V,y=g[3]a;a++)n[a]=e[Math.floor(i/t*a)];return n},_getCandle:function(e,t,i,a,s,r,l,h,d,m,c,p,u,V,U){var g=this.series,y={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery([g[e].data[t],g[e]],"clickable"),hoverable:this.deepQuery([g[e].data[t],g[e]],"hoverable"),style:{x:a,y:[r,l,h,d],width:s,color:m,strokeColor:p,lineWidth:c,brushType:"both"},highlightStyle:{color:u,strokeColor:U,lineWidth:V},_seriesIndex:e};return o.pack(y,g[e],e,g[e].data[t],t,i),y=new n(y)},getMarkCoord:function(e,t){var i=this.series[e],n=this.component.xAxis.getAxis(i.xAxisIndex),a=this.component.yAxis.getAxis(i.yAxisIndex);return["string"!=typeof t.xAxis&&n.getCoordByIndex?n.getCoordByIndex(t.xAxis||0):n.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&a.getCoordByIndex?a.getCoordByIndex(t.yAxis||0):a.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var s,r,l,h,d,m,n=0,a=this.shapeList.length;a>n;n++)if(d=this.shapeList[n]._seriesIndex,i[d]&&!i[d][3]&&"candle"===this.shapeList[n].type){if(m=o.get(this.shapeList[n],"dataIndex"),h=t[d],i[d][2]&&m===h.data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[d][2]&&0===m){this.zr.delShape(this.shapeList[n].id);continue}r=this.component.xAxis.getAxis(h.xAxisIndex||0).getGap(),s=i[d][2]?r:-r,l=0,this.zr.animate(this.shapeList[n].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[s,l]}).start()}}},s.inherits(t,i),e("../chart").define("k",t),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/echarts/chart/line.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/line",["require","./base","zrender/shape/Polyline","../util/shape/Icon","../util/shape/HalfSmoothPolygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}function i(e,t,i){var n=t.x,a=t.y,r=t.width,s=t.height,l=s/2;t.symbol.match("empty")&&(e.fillStyle="#fff"),t.brushType="both";var h=t.symbol.replace("empty","").toLowerCase();h.match("star")?(l=h.replace("star","")-0||5,a-=1,h="star"):("rectangle"===h||"arrow"===h)&&(n+=(r-s)/2,r=s);var m="";if(h.match("image")&&(m=h.replace(new RegExp("^image:\\/\\/"),""),h="image",n+=Math.round((r-s)/2)-1,r=s+=2),h=o.prototype.iconLibrary[h]){var d=t.x,c=t.y;e.moveTo(d,c+l),e.lineTo(d+5,c+l),e.moveTo(d+t.width-5,c+l),e.lineTo(d+t.width,c+l);var p=this;h(e,{x:n+4,y:a+4,width:r-8,height:s-8,n:l,image:m},function(){p.modSelf(),i()})}else e.moveTo(n,a+l),e.lineTo(n+r,a+l)}var n=e("./base"),a=e("zrender/shape/Polyline"),o=e("../util/shape/Icon"),r=e("../util/shape/HalfSmoothPolygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var s=e("../config");s.line={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1};var l=e("../util/ecData"),h=e("zrender/tool/util"),m=e("zrender/tool/color");return t.prototype={type:s.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={},this._buildPosition()},_buildHorizontal:function(e,t,i,n){for(var a,o,r,s,l,h,m,d,c,p=this.series,u=i[0][0],V=p[u],U=this.component.xAxis.getAxis(V.xAxisIndex||0),g={},y=0,f=t;f>y&&null!=U.getNameByIndex(y);y++){o=U.getCoordByIndex(y);for(var b=0,_=i.length;_>b;b++){a=this.component.yAxis.getAxis(p[i[b][0]].yAxisIndex||0),l=s=m=h=a.getCoord(0);for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),g[u]=g[u]||[],n[u]=n[u]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==c?(c>=0?(s-=x>0?a.getCoordSize(c):l-a.getCoord(c),r=s):0>c&&(h+=x>0?a.getCoordSize(c):a.getCoord(c)-m,r=h),g[u].push([o,r,y,U.getNameByIndex(y),o,l]),n[u].min>c&&(n[u].min=c,n[u].minY=r,n[u].minX=o),n[u].max0&&(this.finalPLMap[u]=this.finalPLMap[u]||[],this.finalPLMap[u].push(g[u]),g[u]=[])}s=this.component.grid.getY();for(var L,b=0,_=i.length;_>b;b++)for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),"-"==c&&this.deepQuery([d,V,this.option],"calculable")&&(L=this.deepQuery([d,V],"symbolSize"),s+=2*L+5,r=s,this.shapeList.push(this._getCalculableItem(u,y,U.getNameByIndex(y),o,r,"horizontal")))}for(var v in g)g[v].length>0&&(this.finalPLMap[v]=this.finalPLMap[v]||[],this.finalPLMap[v].push(g[v]),g[v]=[]);this._calculMarkMapXY(n,i,"y"),this._buildBorkenLine(e,this.finalPLMap,U,"horizontal")},_buildVertical:function(e,t,i,n){for(var a,o,r,s,l,h,m,d,c,p=this.series,u=i[0][0],V=p[u],U=this.component.yAxis.getAxis(V.yAxisIndex||0),g={},y=0,f=t;f>y&&null!=U.getNameByIndex(y);y++){r=U.getCoordByIndex(y);for(var b=0,_=i.length;_>b;b++){a=this.component.xAxis.getAxis(p[i[b][0]].xAxisIndex||0),l=s=m=h=a.getCoord(0);for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),g[u]=g[u]||[],n[u]=n[u]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==c?(c>=0?(s+=x>0?a.getCoordSize(c):a.getCoord(c)-l,o=s):0>c&&(h-=x>0?a.getCoordSize(c):m-a.getCoord(c),o=h),g[u].push([o,r,y,U.getNameByIndex(y),l,r]),n[u].min>c&&(n[u].min=c,n[u].minX=o,n[u].minY=r),n[u].max0&&(this.finalPLMap[u]=this.finalPLMap[u]||[],this.finalPLMap[u].push(g[u]),g[u]=[])}s=this.component.grid.getXend();for(var L,b=0,_=i.length;_>b;b++)for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),"-"==c&&this.deepQuery([d,V,this.option],"calculable")&&(L=this.deepQuery([d,V],"symbolSize"),s-=2*L+5,o=s,this.shapeList.push(this._getCalculableItem(u,y,U.getNameByIndex(y),o,r,"vertical")))}for(var v in g)g[v].length>0&&(this.finalPLMap[v]=this.finalPLMap[v]||[],this.finalPLMap[v].push(g[v]),g[v]=[]);this._calculMarkMapXY(n,i,"x"),this._buildBorkenLine(e,this.finalPLMap,U,"vertical")},_buildOther:function(e,t,i,n){for(var a,o=this.series,r={},s=0,l=i.length;l>s;s++)for(var h=0,m=i[s].length;m>h;h++){var d=i[s][h],c=o[d];a=this.component.xAxis.getAxis(c.xAxisIndex||0);var p=this.component.yAxis.getAxis(c.yAxisIndex||0),u=p.getCoord(0);r[d]=r[d]||[],n[d]=n[d]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var V=0,U=c.data.length;U>V;V++){var g=c.data[V],y=this.getDataFromOption(g,"-");if(y instanceof Array){var f=a.getCoord(y[0]),b=p.getCoord(y[1]);r[d].push([f,b,V,y[0],f,u]),n[d].min0>y[0]&&(n[d].min0=y[0],n[d].minY0=b,n[d].minX0=f),n[d].max0y[1]&&(n[d].min1=y[1],n[d].minY1=b,n[d].minX1=f),n[d].max10&&(this.finalPLMap[_]=this.finalPLMap[_]||[],this.finalPLMap[_].push(r[_]),r[_]=[]);this._calculMarkMapXY(n,i,"xy"),this._buildBorkenLine(e,this.finalPLMap,a,"other")},_buildBorkenLine:function(e,t,i,n){for(var o,s="other"==n?"horizontal":n,d=this.series,c=e.length-1;c>=0;c--){var p=e[c],u=d[p],V=t[p];if(u.type===this.type&&null!=V)for(var U=this._getBbox(p,s),g=this._sIndex2ColorMap[p],y=this.query(u,"itemStyle.normal.lineStyle.width"),f=this.query(u,"itemStyle.normal.lineStyle.type"),b=this.query(u,"itemStyle.normal.lineStyle.color"),_=this.getItemStyleColor(this.query(u,"itemStyle.normal.color"),p,-1),x=null!=this.query(u,"itemStyle.normal.areaStyle"),k=this.query(u,"itemStyle.normal.areaStyle.color"),L=0,v=V.length;v>L;L++){var W=V[L],w="other"!=n&&this._isLarge(s,W);if(w)W=this._getLargePointList(s,W);else for(var X=0,I=W.length;I>X;X++)o=u.data[W[X][2]],(this.deepQuery([o,u,this.option],"calculable")||this.deepQuery([o,u],"showAllSymbol")||"categoryAxis"===i.type&&i.isMainAxis(W[X][2])&&"none"!=this.deepQuery([o,u],"symbol"))&&this.shapeList.push(this._getSymbol(p,W[X][2],W[X][3],W[X][0],W[X][1],s));var K=new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:y,pointList:W,strokeColor:b||_||g,lineWidth:y,lineType:f,smooth:this._getSmooth(u.smooth),smoothConstraint:U,shadowColor:this.query(u,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(u,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(u,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(u,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:p,_orient:s});if(l.pack(K,d[p],p,0,L,d[p].name),this.shapeList.push(K),x){var S=new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:y,pointList:h.clone(W).concat([[W[W.length-1][4],W[W.length-1][5]],[W[0][4],W[0][5]]]),brushType:"fill",smooth:this._getSmooth(u.smooth),smoothConstraint:U,color:k?k:m.alpha(g,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:p,_orient:s});l.pack(S,d[p],p,0,L,d[p].name),this.shapeList.push(S)}}}},_getBbox:function(e,t){var i=this.component.grid.getBbox(),n=this.xMarkMap[e];return null!=n.minX0?[[Math.min(n.minX0,n.maxX0,n.minX1,n.maxX1),Math.min(n.minY0,n.maxY0,n.minY1,n.maxY1)],[Math.max(n.minX0,n.maxX0,n.minX1,n.maxX1),Math.max(n.minY0,n.maxY0,n.minY1,n.maxY1)]]:("horizontal"===t?(i[0][1]=Math.min(n.minY,n.maxY),i[1][1]=Math.max(n.minY,n.maxY)):(i[0][0]=Math.min(n.minX,n.maxX),i[1][0]=Math.max(n.minX,n.maxX)),i)},_isLarge:function(e,t){return t.length<2?!1:"horizontal"===e?Math.abs(t[0][0]-t[1][0])<.5:Math.abs(t[0][1]-t[1][1])<.5},_getLargePointList:function(e,t){var i;i="horizontal"===e?this.component.grid.getWidth():this.component.grid.getHeight();for(var n=t.length,a=[],o=0;i>o;o++)a[o]=t[Math.floor(n/i*o)];return a},_getSmooth:function(e){return e?.3:0},_getCalculableItem:function(e,t,i,n,a,o){var r=this.series,l=r[e].calculableHolderColor||this.ecTheme.calculableHolderColor||s.calculableHolderColor,h=this._getSymbol(e,t,i,n,a,o);return h.style.color=l,h.style.strokeColor=l,h.rotation=[0,0],h.hoverable=!1,h.draggable=!1,h.style.text=void 0,h},_getSymbol:function(e,t,i,n,a,o){var r=this.series,s=r[e],l=s.data[t],h=this.getSymbolShape(s,e,l,t,i,n,a,this._sIndex2ShapeMap[e],this._sIndex2ColorMap[e],"#fff","vertical"===o?"horizontal":"vertical");return h.zlevel=this.getZlevelBase(),h.z=this.getZBase()+1,this.deepQuery([l,s,this.option],"calculable")&&(this.setCalculable(h),h.draggable=!0),h},getMarkCoord:function(e,t){var i=this.series[e],n=this.xMarkMap[e],a=this.component.xAxis.getAxis(i.xAxisIndex),o=this.component.yAxis.getAxis(i.yAxisIndex);if(t.type&&("max"===t.type||"min"===t.type||"average"===t.type)){var r=null!=t.valueIndex?t.valueIndex:null!=n.maxX0?"1":"";return[n[t.type+"X"+r],n[t.type+"Y"+r],n[t.type+"Line"+r],n[t.type+r]]}return["string"!=typeof t.xAxis&&a.getCoordByIndex?a.getCoordByIndex(t.xAxis||0):a.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&o.getCoordByIndex?o.getCoordByIndex(t.yAxis||0):o.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ontooltipHover:function(e,t){for(var i,n,a=e.seriesIndex,o=e.dataIndex,r=a.length;r--;)if(i=this.finalPLMap[a[r]])for(var s=0,l=i.length;l>s;s++){n=i[s];for(var h=0,m=n.length;m>h;h++)o===n[h][2]&&t.push(this._getSymbol(a[r],n[h][2],n[h][3],n[h][0],n[h][1],"horizontal"))}},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var o,r,s,l,h,m,d,n=this.shapeList.length-1;n>=0;n--)if(h=this.shapeList[n]._seriesIndex,i[h]&&!i[h][3]){if(this.shapeList[n]._main&&this.shapeList[n].style.pointList.length>1){if(m=this.shapeList[n].style.pointList,r=Math.abs(m[0][0]-m[1][0]),l=Math.abs(m[0][1]-m[1][1]),d="horizontal"===this.shapeList[n]._orient,i[h][2]){if("half-smooth-polygon"===this.shapeList[n].type){var c=m.length;this.shapeList[n].style.pointList[c-3]=m[c-2],this.shapeList[n].style.pointList[c-3][d?0:1]=m[c-4][d?0:1],this.shapeList[n].style.pointList[c-2]=m[c-1]}this.shapeList[n].style.pointList.pop(),d?(o=r,s=0):(o=0,s=-l)}else{if(this.shapeList[n].style.pointList.shift(),"half-smooth-polygon"===this.shapeList[n].type){var p=this.shapeList[n].style.pointList.pop();d?p[0]=m[0][0]:p[1]=m[0][1],this.shapeList[n].style.pointList.push(p)}d?(o=-r,s=0):(o=0,s=l)}this.zr.modShape(this.shapeList[n].id,{style:{pointList:this.shapeList[n].style.pointList}},!0)}else{if(i[h][2]&&this.shapeList[n]._dataIndex===t[h].data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[h][2]&&0===this.shapeList[n]._dataIndex){this.zr.delShape(this.shapeList[n].id);continue}}this.shapeList[n].position=[0,0],this.zr.animate(this.shapeList[n].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[o,s]}).start()}}},o.prototype.iconLibrary.legendLineIcon=i,h.inherits(t,n),e("../chart").define("line",t),t}),define("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),a=e("zrender/tool/util");return t.prototype={type:"half-smooth-polygon",buildPath:function(t,i){var a=i.pointList;if(!(a.length<2))if(i.smooth){var o=n(a.slice(0,-2),i.smooth,!1,i.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var r,s,l,h=a.length,m=0;h-3>m;m++)r=o[2*m],s=o[2*m+1],l=a[m+1],t.bezierCurveTo(r[0],r[1],s[0],s[1],l[0],l[1]);t.lineTo(a[h-2][0],a[h-2][1]),t.lineTo(a[h-1][0],a[h-1][1]),t.lineTo(a[0][0],a[0][1])}else e("zrender/shape/Polygon").prototype.buildPath(t,i)}},a.inherits(t,i),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/echarts/chart/pie.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/pie",["require","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/Polyline","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o);var s=this;s.shapeHandler.onmouseover=function(e){var t=e.target,i=h.get(t,"seriesIndex"),n=h.get(t,"dataIndex"),a=h.get(t,"special"),o=[t.style.x,t.style.y],r=t.style.startAngle,l=t.style.endAngle,d=((l+r)/2+360)%360,m=t.highlightStyle.color,c=s.getLabel(i,n,a,o,d,m,!0);c&&s.zr.addHoverShape(c);var p=s.getLabelLine(i,n,o,t.style.r0,t.style.r,d,m,!0);p&&s.zr.addHoverShape(p)},this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Ring"),o=e("zrender/shape/Circle"),s=e("zrender/shape/Sector"),r=e("zrender/shape/Polyline"),l=e("../config");l.pie={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}};var h=e("../util/ecData"),d=e("zrender/tool/util"),m=e("zrender/tool/math"),c=e("zrender/tool/color");return t.prototype={type:l.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var i,n,s;this._selectedMode=!1;for(var r,d=0,m=e.length;m>d;d++)if(e[d].type===l.CHART_TYPE_PIE){if(e[d]=this.reformOption(e[d]),this.legendHoverLink=e[d].legendHoverLink||this.legendHoverLink,r=e[d].name||"",this.selectedMap[r]=t?t.isSelected(r):!0,!this.selectedMap[r])continue;i=this.parseCenter(this.zr,e[d].center),n=this.parseRadius(this.zr,e[d].radius),this._selectedMode=this._selectedMode||e[d].selectedMode,this._selected[d]=[],this.deepQuery([e[d],this.option],"calculable")&&(s={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:i[0],y:i[1],r0:n[0]<=10?0:n[0]-10,r:n[1]+10,brushType:"stroke",lineWidth:1,strokeColor:e[d].calculableHolderColor||this.ecTheme.calculableHolderColor||l.calculableHolderColor}},h.pack(s,e[d],d,void 0,-1),this.setCalculable(s),s=n[0]<=10?new o(s):new a(s),this.shapeList.push(s)),this._buildSinglePie(d),this.buildMark(d)}this.addShapeList()},_buildSinglePie:function(e){for(var t,i=this.series,n=i[e],a=n.data,o=this.component.legend,s=0,r=0,l=0,h=Number.NEGATIVE_INFINITY,d=[],m=0,c=a.length;c>m;m++)t=a[m].name,this.selectedMap[t]=o?o.isSelected(t):!0,this.selectedMap[t]&&!isNaN(a[m].value)&&(0!==+a[m].value?s++:r++,l+=+a[m].value,h=Math.max(h,+a[m].value));if(0!==l){for(var p,u,V,g,U,y,f=100,b=n.clockWise,_=(n.startAngle.toFixed(2)-0+360)%360,x=n.minAngle||.01,k=360-x*s-.01*r,L=n.roseType,m=0,c=a.length;c>m;m++)if(t=a[m].name,this.selectedMap[t]&&!isNaN(a[m].value)){if(u=o?o.getColor(t):this.zr.getColor(m),f=a[m].value/l,p="area"!=L?b?_-f*k-(0!==f?x:.01):f*k+_+(0!==f?x:.01):b?_-360/c:360/c+_,p=p.toFixed(2)-0,f=(100*f).toFixed(2),V=this.parseCenter(this.zr,n.center),g=this.parseRadius(this.zr,n.radius),U=+g[0],y=+g[1],"radius"===L?y=a[m].value/h*(y-U)*.8+.2*(y-U)+U:"area"===L&&(y=Math.sqrt(a[m].value/h)*(y-U)+U),b){var v;v=_,_=p,p=v}this._buildItem(d,e,m,f,a[m].selected,V,U,y,_,p,u),b||(_=p)}this._autoLabelLayout(d,V,y);for(var m=0,c=d.length;c>m;m++)this.shapeList.push(d[m]);d=null}},_buildItem:function(e,t,i,n,a,o,s,r,l,d,m){var c=this.series,p=((d+l)/2+360)%360,u=this.getSector(t,i,n,a,o,s,r,l,d,m);h.pack(u,c[t],t,c[t].data[i],i,c[t].data[i].name,n),e.push(u);var V=this.getLabel(t,i,n,o,p,m,!1),g=this.getLabelLine(t,i,o,s,r,p,m,!1);g&&(h.pack(g,c[t],t,c[t].data[i],i,c[t].data[i].name,n),e.push(g)),V&&(h.pack(V,c[t],t,c[t].data[i],i,c[t].data[i].name,n),V._labelLine=g,e.push(V))},getSector:function(e,t,i,n,a,o,r,l,h,d){var p=this.series,u=p[e],V=u.data[t],g=[V,u],U=this.deepMerge(g,"itemStyle.normal")||{},y=this.deepMerge(g,"itemStyle.emphasis")||{},f=this.getItemStyleColor(U.color,e,t,V)||d,b=this.getItemStyleColor(y.color,e,t,V)||("string"==typeof f?c.lift(f,-.2):f),_={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(g,"clickable"),style:{x:a[0],y:a[1],r0:o,r:r,startAngle:l,endAngle:h,brushType:"both",color:f,lineWidth:U.borderWidth,strokeColor:U.borderColor,lineJoin:"round"},highlightStyle:{color:b,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(n){var x=((_.style.startAngle+_.style.endAngle)/2).toFixed(2)-0;_.style._hasSelected=!0,_.style._x=_.style.x,_.style._y=_.style.y;var k=this.query(u,"selectedOffset");_.style.x+=m.cos(x,!0)*k,_.style.y-=m.sin(x,!0)*k,this._selected[e][t]=!0}else this._selected[e][t]=!1;return this._selectedMode&&(_.onclick=this.shapeHandler.onclick),this.deepQuery([V,u,this.option],"calculable")&&(this.setCalculable(_),_.draggable=!0),(this._needLabel(u,V,!0)||this._needLabelLine(u,V,!0))&&(_.onmouseover=this.shapeHandler.onmouseover),_=new s(_)},getLabel:function(e,t,i,a,o,s,r){var l=this.series,h=l[e],c=h.data[t];if(this._needLabel(h,c,r)){var p,u,V,g=r?"emphasis":"normal",U=d.merge(d.clone(c.itemStyle)||{},h.itemStyle),y=U[g].label,f=y.textStyle||{},b=a[0],_=a[1],x=this.parseRadius(this.zr,h.radius),k="middle";y.position=y.position||U.normal.label.position,"center"===y.position?(p=b,u=_,V="center"):"inner"===y.position||"inside"===y.position?(x=(x[0]+x[1])*(y.distance||.5),p=Math.round(b+x*m.cos(o,!0)),u=Math.round(_-x*m.sin(o,!0)),s="#fff",V="center"):(x=x[1]- -U[g].labelLine.length,p=Math.round(b+x*m.cos(o,!0)),u=Math.round(_-x*m.sin(o,!0)),V=o>=90&&270>=o?"right":"left"),"center"!=y.position&&"inner"!=y.position&&"inside"!=y.position&&(p+="left"===V?20:-20),c.__labelX=p-("left"===V?5:-5),c.__labelY=u;var L=new n({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{x:p,y:u,color:f.color||s,text:this.getLabelText(e,t,i,g),textAlign:f.align||V,textBaseline:f.baseline||k,textFont:this.getFont(f)},highlightStyle:{brushType:"fill"}});return L._radius=x,L._labelPosition=y.position||"outer",L._rect=L.getRect(L.style),L._seriesIndex=e,L._dataIndex=t,L}},getLabelText:function(e,t,i,n){var a=this.series,o=a[e],s=o.data[t],r=this.deepQuery([s,o],"itemStyle."+n+".label.formatter");return r?"function"==typeof r?r.call(this.myChart,{seriesIndex:e,seriesName:o.name||"",series:o,dataIndex:t,data:s,name:s.name,value:s.value,percent:i}):"string"==typeof r?(r=r.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),r=r.replace("{a0}",o.name).replace("{b0}",s.name).replace("{c0}",s.value).replace("{d0}",i)):void 0:s.name},getLabelLine:function(e,t,i,n,a,o,s,l){var h=this.series,c=h[e],p=c.data[t];if(this._needLabelLine(c,p,l)){var u=l?"emphasis":"normal",V=d.merge(d.clone(p.itemStyle)||{},c.itemStyle),g=V[u].labelLine,U=g.lineStyle||{},y=i[0],f=i[1],b=a,_=this.parseRadius(this.zr,c.radius)[1]- -g.length,x=m.cos(o,!0),k=m.sin(o,!0);return new r({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{pointList:[[y+b*x,f-b*k],[y+_*x,f-_*k],[p.__labelX,p.__labelY]],strokeColor:U.color||s,lineType:U.type,lineWidth:U.width},_seriesIndex:e,_dataIndex:t})}},_needLabel:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".labelLine.show")},_autoLabelLayout:function(e,t,i){for(var n=[],a=[],o=0,s=e.length;s>o;o++)("outer"===e[o]._labelPosition||"outside"===e[o]._labelPosition)&&(e[o]._rect._y=e[o]._rect.y,e[o]._rect.xa;a++)if(e[a]._rect.y+=n,e[a].style.y+=n,e[a]._labelLine&&(e[a]._labelLine.style.pointList[1][1]+=n,e[a]._labelLine.style.pointList[2][1]+=n),a>t&&i>a+1&&e[a+1]._rect.y>e[a]._rect.y+e[a]._rect.height)return void o(a,n/2);o(i-1,n/2)}function o(t,i){for(var n=t;n>=0&&(e[n]._rect.y-=i,e[n].style.y-=i,e[n]._labelLine&&(e[n]._labelLine.style.pointList[1][1]-=i,e[n]._labelLine.style.pointList[2][1]-=i),!(n>0&&e[n]._rect.y>e[n-1]._rect.y+e[n-1]._rect.height));n--);}function s(e,t,i,n,a){for(var o,s,r,l=i[0],h=i[1],d=a>0?t?Number.MAX_VALUE:0:t?Number.MAX_VALUE:0,m=0,c=e.length;c>m;m++)s=Math.abs(e[m]._rect.y-h),r=e[m]._radius-n,o=n+r>s?Math.sqrt((n+r+20)*(n+r+20)-Math.pow(e[m]._rect.y-h,2)):Math.abs(e[m]._rect.x+(a>0?0:e[m]._rect.width)-l),t&&o>=d&&(o=d-10),!t&&d>=o&&(o=d+10),e[m]._rect.x=e[m].style.x=l+o*a,e[m]._labelLine&&(e[m]._labelLine.style.pointList[2][0]=l+(o-5)*a,e[m]._labelLine.style.pointList[1][0]=l+(o-20)*a),d=o}e.sort(function(e,t){return e._rect.y-t._rect.y});for(var r,l=0,h=e.length,d=[],m=[],c=0;h>c;c++)r=e[c]._rect.y-l,0>r&&a(c,h,-r,n),l=e[c]._rect.y+e[c]._rect.height;this.zr.getHeight()-l<0&&o(h-1,l-this.zr.getHeight());for(var c=0;h>c;c++)e[c]._rect.y>=t[1]?m.push(e[c]):d.push(e[c]);s(m,!0,t,i,n),s(d,!1,t,i,n)},reformOption:function(e){var t=d.merge;return e=t(t(e||{},d.clone(this.ecTheme.pie||{})),d.clone(l.pie)),e.itemStyle.normal.label.textStyle=this.getTextStyle(e.itemStyle.normal.label.textStyle),e.itemStyle.emphasis.label.textStyle=this.getTextStyle(e.itemStyle.emphasis.label.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];var o={},s={},r={},h=this.shapeList;this.shapeList=[];for(var d,m,c,p={},n=0,a=e.length;a>n;n++)d=e[n][0],m=e[n][2],c=e[n][3],t[d]&&t[d].type===l.CHART_TYPE_PIE&&(m?(c||(o[d+"_"+t[d].data.length]="delete"),p[d]=1):c?p[d]=0:(o[d+"_-1"]="delete",p[d]=-1),this._buildSinglePie(d));for(var u,V,n=0,a=this.shapeList.length;a>n;n++)switch(d=this.shapeList[n]._seriesIndex,u=this.shapeList[n]._dataIndex,V=d+"_"+u,this.shapeList[n].type){case"sector":o[V]=this.shapeList[n];break;case"text":s[V]=this.shapeList[n];break;case"polyline":r[V]=this.shapeList[n]}this.shapeList=[];for(var g,n=0,a=h.length;a>n;n++)if(d=h[n]._seriesIndex,i[d]){if(u=h[n]._dataIndex+p[d],V=d+"_"+u,g=o[V],!g)continue;if("sector"===h[n].type)"delete"!=g?this.zr.animate(h[n].id,"style").when(400,{startAngle:g.style.startAngle,endAngle:g.style.endAngle}).start():this.zr.animate(h[n].id,"style").when(400,p[d]<0?{startAngle:h[n].style.startAngle}:{endAngle:h[n].style.endAngle}).start();else if("text"===h[n].type||"polyline"===h[n].type)if("delete"===g)this.zr.delShape(h[n].id);else switch(h[n].type){case"text":g=s[V],this.zr.animate(h[n].id,"style").when(400,{x:g.style.x,y:g.style.y}).start();break;case"polyline":g=r[V],this.zr.animate(h[n].id,"style").when(400,{pointList:g.style.pointList}).start()}}this.shapeList=h},onclick:function(e){var t=this.series;if(this.isClick&&e.target){this.isClick=!1;for(var i,n=e.target,a=n.style,o=h.get(n,"seriesIndex"),s=h.get(n,"dataIndex"),r=0,d=this.shapeList.length;d>r;r++)if(this.shapeList[r].id===n.id){if(o=h.get(n,"seriesIndex"),s=h.get(n,"dataIndex"),a._hasSelected)n.style.x=n.style._x,n.style.y=n.style._y,n.style._hasSelected=!1,this._selected[o][s]=!1;else{var c=((a.startAngle+a.endAngle)/2).toFixed(2)-0;n.style._hasSelected=!0,this._selected[o][s]=!0,n.style._x=n.style.x,n.style._y=n.style.y,i=this.query(t[o],"selectedOffset"),n.style.x+=m.cos(c,!0)*i,n.style.y-=m.sin(c,!0)*i}this.zr.modShape(n.id,n)}else this.shapeList[r].style._hasSelected&&"single"===this._selectedMode&&(o=h.get(this.shapeList[r],"seriesIndex"),s=h.get(this.shapeList[r],"dataIndex"),this.shapeList[r].style.x=this.shapeList[r].style._x,this.shapeList[r].style.y=this.shapeList[r].style._y,this.shapeList[r].style._hasSelected=!1,this._selected[o][s]=!1,this.zr.modShape(this.shapeList[r].id,this.shapeList[r]));this.messageCenter.dispatch(l.EVENT.PIE_SELECTED,e.event,{selected:this._selected,target:h.get(n,"name")},this.myChart),this.zr.refreshNextFrame()}}},d.inherits(t,i),e("../chart").define("pie",t),t}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/echarts/chart/radar.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/radar",["require","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Polygon");e("../component/polar");var a=e("../config");a.radar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2};var o=e("../util/ecData"),s=e("zrender/tool/util"),r=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;for(var e,t=this.series,i=this.component.legend,n=0,o=t.length;o>n;n++)t[n].type===a.CHART_TYPE_RADAR&&(this.serie=this.reformOption(t[n]),this.legendHoverLink=t[n].legendHoverLink||this.legendHoverLink,e=this.serie.name||"",this.selectedMap[e]=i?i.isSelected(e):!0,this.selectedMap[e]&&(this._queryTarget=[this.serie,this.option],this.deepQuery(this._queryTarget,"calculable")&&this._addDropBox(n),this._buildSingleRadar(n),this.buildMark(n)));this.addShapeList()},_buildSingleRadar:function(e){for(var t,i,n,a,o=this.component.legend,s=this.serie.data,r=this.deepQuery(this._queryTarget,"calculable"),l=0;ls;s++)n=this.getDataFromOption(t.value[s]),i="-"!=n?o.getVector(e,s,n):!1,i&&a.push(i);return a},_addSymbol:function(e,t,i,n,a){for(var s,r=this.series,l=this.component.polar,h=0,d=e.length;d>h;h++)s=this.getSymbolShape(this.deepMerge([r[n].data[i],r[n]]),n,r[n].data[i].value[h],h,l.getIndicatorText(a,h),e[h][0],e[h][1],this._symbol[this._radarDataCounter%this._symbol.length],t,"#fff","vertical"),s.zlevel=this.getZlevelBase(),s.z=this.getZBase()+1,o.set(s,"data",r[n].data[i]),o.set(s,"value",r[n].data[i].value),o.set(s,"dataIndex",i),o.set(s,"special",h),this.shapeList.push(s)},_addDataShape:function(e,t,i,a,s,l){var h=this.series,d=[i,this.serie],m=this.getItemStyleColor(this.deepQuery(d,"itemStyle.normal.color"),a,s,i),c=this.deepQuery(d,"itemStyle.normal.lineStyle.width"),p=this.deepQuery(d,"itemStyle.normal.lineStyle.type"),u=this.deepQuery(d,"itemStyle.normal.areaStyle.color"),V=this.deepQuery(d,"itemStyle.normal.areaStyle"),g={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:V?"both":"stroke",color:u||m||("string"==typeof t?r.alpha(t,.5):t),strokeColor:m||t,lineWidth:c,lineType:p},highlightStyle:{brushType:this.deepQuery(d,"itemStyle.emphasis.areaStyle")||V?"both":"stroke",color:this.deepQuery(d,"itemStyle.emphasis.areaStyle.color")||u||m||("string"==typeof t?r.alpha(t,.5):t),strokeColor:this.getItemStyleColor(this.deepQuery(d,"itemStyle.emphasis.color"),a,s,i)||m||t,lineWidth:this.deepQuery(d,"itemStyle.emphasis.lineStyle.width")||c,lineType:this.deepQuery(d,"itemStyle.emphasis.lineStyle.type")||p}};o.pack(g,h[a],a,i,s,i.name,this.component.polar.getIndicator(h[a].polarIndex)),l&&(g.draggable=!0,this.setCalculable(g)),g=new n(g),this.shapeList.push(g)},_addDropBox:function(e){var t=this.series,i=this.deepQuery(this._queryTarget,"polarIndex");if(!this._dropBoxList[i]){var n=this.component.polar.getDropBox(i);n.zlevel=this.getZlevelBase(),n.z=this.getZBase(),this.setCalculable(n),o.pack(n,t,e,void 0,-1),this.shapeList.push(n),this._dropBoxList[i]=!0}},ondragend:function(e,t){var i=this.series;if(this.isDragend&&e.target){var n=e.target,a=o.get(n,"seriesIndex"),s=o.get(n,"dataIndex");this.component.legend&&this.component.legend.del(i[a].data[s].name),i[a].data.splice(s,1),t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},ondrop:function(t,i){var n=this.series;if(this.isDrop&&t.target){var a,s,r=t.target,l=t.dragged,h=o.get(r,"seriesIndex"),d=o.get(r,"dataIndex"),m=this.component.legend;if(-1===d)a={value:o.get(l,"value"),name:o.get(l,"name")},n[h].data.push(a),m&&m.add(a.name,l.style.color||l.style.strokeColor);else{var c=e("../util/accMath");a=n[h].data[d],m&&m.del(a.name),a.name+=this.option.nameConnector+o.get(l,"name"),s=o.get(l,"value");for(var p=0;ph;h++)t=d.polar2cartesian(r,o*Math.PI/180+s*h),l.push({vector:[t[1],-t[0]]})},_getRadius:function(){var e=this.polar[this._index];return this.parsePercent(e.radius,Math.min(this.zr.getWidth(),this.zr.getHeight())/2)},_buildSpiderWeb:function(e){var t=this.polar[e],i=t.__ecIndicator,n=t.splitArea,a=t.splitLine,o=this.getCenter(e),s=t.splitNumber,r=a.lineStyle.color,l=a.lineStyle.width,h=a.show,d=this.deepQuery(this._queryTarget,"axisLine");this._addArea(i,s,o,n,r,l,h),d.show&&this._addLine(i,o,d)},_addAxisLabel:function(t){for(var i,a,o,s,a,r,l,d,m,c,p=e("../util/accMath"),u=this.polar[t],V=this.deepQuery(this._queryTarget,"indicator"),g=u.__ecIndicator,U=this.deepQuery(this._queryTarget,"splitNumber"),y=this.getCenter(t),f=0;f=b;b+=c+1)s=h.merge({},o),l=p.accAdd(r.min,p.accMul(r.step,b)),s.text=this.numAddCommas(l),s.x=b*a[0]/U+Math.cos(d)*m+y[0],s.y=b*a[1]/U+Math.sin(d)*m+y[1],this.shapeList.push(new n({zlevel:this.getZlevelBase(),z:this.getZBase(),style:s,draggable:!1,hoverable:!1}))}},_buildText:function(e){for(var t,i,a,o,s,r,l,h=this.polar[e],d=h.__ecIndicator,m=this.deepQuery(this._queryTarget,"indicator"),c=this.getCenter(e),p=0,u=0,V=0;V0?"left":Math.round(t[0])<0?"right":"center",null==o.margin?t=this._mapVector(t,c,1.1):(r=o.margin,p=t[0]>0?r:-r,u=t[1]>0?r:-r,p=0===t[0]?0:p,u=0===t[1]?0:u,t=this._mapVector(t,c,1)),i.textAlign=a,i.x=t[0]+p,i.y=t[1]+u,s=o.rotate?[o.rotate/180*Math.PI,t[0],t[1]]:[0,0,0],this.shapeList.push(new n({zlevel:this.getZlevelBase(),z:this.getZBase(),style:i,draggable:!1,hoverable:!1,rotation:s})))},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var t,i,e=e||0,n=this.polar[e],a=this.getCenter(e),o=n.__ecIndicator,s=o.length,r=[],l=n.type;if("polygon"==l){for(var h=0;s>h;h++)t=o[h].vector,r.push(this._mapVector(t,a,1.2));i=this._getShape(r,"fill","rgba(0,0,0,0)","",1)}else"circle"==l&&(i=this._getCircle("",1,1.2,a,"fill","rgba(0,0,0,0)"));return i},_addArea:function(e,t,i,n,a,o,s){for(var r,l,h,d,m=this.deepQuery(this._queryTarget,"type"),c=0;t>c;c++)l=(t-c)/t,s&&("polygon"==m?(d=this._getPointList(e,l,i),r=this._getShape(d,"stroke","",a,o)):"circle"==m&&(r=this._getCircle(a,o,l,i,"stroke")),this.shapeList.push(r)),n.show&&(h=(t-c-1)/t,this._addSplitArea(e,n,l,h,i,c))},_getCircle:function(e,t,i,n,a,o){var r=this._getRadius();return new s({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n[0],y:n[1],r:r*i,brushType:a,strokeColor:e,lineWidth:t,color:o},hoverable:!1,draggable:!1})},_getRing:function(e,t,i,n){var a=this._getRadius();return new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n[0],y:n[1],r:t*a,r0:i*a,color:e,brushType:"fill"},hoverable:!1,draggable:!1})},_getPointList:function(e,t,i){for(var n,a=[],o=e.length,s=0;o>s;s++)n=e[s].vector,a.push(this._mapVector(n,i,t));return a},_getShape:function(e,t,i,n,a){return new o({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:t,color:i,strokeColor:n,lineWidth:a},hoverable:!1,draggable:!1})},_addSplitArea:function(e,t,i,n,a,o){var s,r,l,h,d,m=e.length,c=t.areaStyle.color,p=[],m=e.length,u=this.deepQuery(this._queryTarget,"type");if("string"==typeof c&&(c=[c]),r=c.length,s=c[o%r],"polygon"==u)for(var V=0;m>V;V++)p=[],l=e[V].vector,h=e[(V+1)%m].vector,p.push(this._mapVector(l,a,i)),p.push(this._mapVector(l,a,n)),p.push(this._mapVector(h,a,n)),p.push(this._mapVector(h,a,i)),d=this._getShape(p,"fill",s,"",1),this.shapeList.push(d);else"circle"==u&&(d=this._getRing(s,i,n,a),this.shapeList.push(d))},_mapVector:function(e,t,i){return[e[0]*i+t[0],e[1]*i+t[1]]},getCenter:function(e){var e=e||0;return this.parseCenter(this.zr,this.polar[e].center)},_addLine:function(e,t,i){for(var n,a,o=e.length,s=i.lineStyle,r=s.color,l=s.width,h=s.type,d=0;o>d;d++)a=e[d].vector,n=this._getLine(t[0],t[1],a[0]+t[0],a[1]+t[1],r,l,h),this.shapeList.push(n)},_getLine:function(e,t,i,n,o,s,r){return new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:e,yStart:t,xEnd:i,yEnd:n,strokeColor:o,lineWidth:s,lineType:r},hoverable:!1})},_adjustIndicatorValue:function(t){for(var i,n,a=this.polar[t],o=this.deepQuery(this._queryTarget,"indicator"),s=o.length,r=a.__ecIndicator,l=this._getSeriesData(t),h=a.boundaryGap,d=a.splitNumber,m=a.scale,c=e("../util/smartSteps"),p=0;s>p;p++){if("number"==typeof o[p].max)i=o[p].max,n=o[p].min||0;else{var u=this._findValue(l,p,d,h);n=u.min,i=u.max}!m&&n>=0&&i>=0&&(n=0),!m&&0>=n&&0>=i&&(i=0);var V=c(n,i,d);r[p].value={min:V.min,max:V.max,step:V.step}}},_getSeriesData:function(e){for(var t,i,n,a=[],o=this.component.legend,s=0;so||void 0===o)&&(o=e),(s>e||void 0===s)&&(s=e)}var o,s,r;if(e&&0!==e.length){if(1==e.length&&(s=0),1!=e.length)for(var l=0;l0?s=o/i:o/=i),{max:o,min:s}}},getVector:function(e,t,i){e=e||0,t=t||0;var n=this.polar[e].__ecIndicator;if(!(t>=n.length)){var a,o=this.polar[e].__ecIndicator[t],s=this.getCenter(e),r=o.vector,l=o.value.max,h=o.value.min;if("undefined"==typeof i)return s;switch(i){case"min":i=h;break;case"max":i=l;break;case"center":i=(l+h)/2}return a=l!=h?(i-h)/(l-h):.5,this._mapVector(r,s,a)}},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){for(var t,i,n,a,o,s,r,l,h,m=0;ma[0])return{polarIndex:m,valueIndex:Math.floor((h+l/2)/l)%r}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},h.inherits(t,i),e("../component").define("polar",t),t}),define("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function t(e,t){return[e*n.sin(t),e*n.cos(t)]}function i(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var n=e("zrender/tool/math");return{polar2cartesian:t,cartesian2polar:i}}); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/exceptiondetail.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var initEvent = function () { 3 | initDependency(); 4 | initLineEcharts(); 5 | }; 6 | 7 | var initDependency = function () { 8 | $('.ui.dropdown').dropdown({ 9 | onChange: function (value) { 10 | $("#h_uDate").val(value); 11 | initLineEcharts(); 12 | } 13 | }) 14 | }; 15 | var initLineEcharts = function () { 16 | // 路径配置 17 | require.config({ 18 | paths: { 19 | echarts: 'resources/js/echarts' 20 | } 21 | }); 22 | 23 | var asynCharts; 24 | require( 25 | [ 26 | 'echarts', 27 | 'echarts/chart/line', 28 | 'echarts/chart/bar' 29 | ], 30 | function (ec) { 31 | asynCharts = ec.init(document.getElementById('exceptionHoursDetail')); 32 | asynCharts.showLoading({ 33 | text: "正在努力加载哦……" 34 | }); 35 | var options = { 36 | title: { 37 | text: '异常详情', 38 | link:'http://webms.elong.com/log/LogError/LogErrorList.html?productLine=onlineweb', 39 | subtext: "周期对比", 40 | textStyle:{ 41 | fontSize: 18, 42 | fontWeight: 'bolder', 43 | color: '#00b2f3' 44 | } 45 | }, 46 | tooltip: { 47 | trigger: 'axis', 48 | showDelay: 0, 49 | hideDelay: 50 50 | }, 51 | legend: { 52 | orient: 'horizontal', 53 | x: 'center', 54 | y: 'top', 55 | data: [] 56 | }, 57 | toolbox: { 58 | show: true, 59 | feature: { 60 | orient: 'horizontal', 61 | x: 'right', 62 | y: 'top', 63 | showTitle: true, 64 | dataZoom: { 65 | show: true, 66 | title: { 67 | dataZoom: '区域缩放', 68 | dataZoomReset: '区域缩放-后退' 69 | } 70 | }, 71 | magicType: { 72 | show: true, 73 | title: { 74 | line: '折线图', 75 | bar: '柱状图', 76 | pie: '饼状图' 77 | }, 78 | type: ['line', 'bar', 'pie'] 79 | }, 80 | restore: { 81 | show: true, 82 | title: '还原' 83 | }, 84 | saveAsImage: { 85 | show: true, 86 | title: '保存为图片', 87 | type: 'jpge', 88 | lang: '点击保存到本地' 89 | } 90 | 91 | } 92 | }, 93 | dataZoom: { 94 | show: true, 95 | height: 15 96 | }, 97 | calculable: true, 98 | xAxis: [ 99 | { 100 | type: 'category', 101 | name: '时间段', 102 | data: [] 103 | } 104 | ], 105 | yAxis: [ 106 | { 107 | type: 'value', 108 | name: '异常次数', 109 | //splitArea: {show :true}, 110 | axisLabel: { 111 | formatter: '{value}次' 112 | } 113 | } 114 | ], 115 | series: [] 116 | 117 | }; 118 | 119 | // ajax 获取数据 120 | $.ajax({ 121 | type: "GET", 122 | async: false, 123 | url: "/getexceptiondetaildata", 124 | data: { 125 | methodName: $("#h_methodName").val(), 126 | uDate: $("#h_uDate").val(), 127 | appName: $("#h_appName").val() 128 | }, 129 | success: function (data) { 130 | if (data) { 131 | options.xAxis[0].data = data.categoryList; 132 | options.series = data.echartsSeriesList; 133 | options.legend.data = data.legendList; 134 | var tUrl="http://webms.elong.com/log/LogError/LogErrorList.html?productLine=onlineweb&logLevel=ERROR&logMsg=&pageUrl=&whereCondition=&serverName=&appName="; 135 | options.title.link =tUrl+$("#h_appName").val()+"&methodname="+$("#h_methodName").val()+"&startTime="+$("#h_uDate").val()+"&endTime="+$("#h_uDate").val(); 136 | 137 | asynCharts.hideLoading(); 138 | asynCharts.setOption(options); 139 | }else{ 140 | asynCharts.hideLoading(); 141 | } 142 | }, 143 | error: function (data) { 144 | asynCharts.hideLoading(); 145 | alert("异常咯!") 146 | } 147 | }); 148 | } 149 | ); 150 | }; 151 | 152 | initEvent(); 153 | })(); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/exceptionreport.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 3 | var initEvent = function () { 4 | // 初始化所有的dropdown 5 | $('.ui.dropdown') 6 | .dropdown() 7 | ; 8 | 9 | initTableData(); 10 | 11 | //加载页面则完成第一次搜索结果展示 12 | $(".c-search").click(); 13 | }; 14 | var initTableData = function () { 15 | // tpl 16 | $.addTemplateFormatter({ 17 | formatExDetail: function (va) { 18 | var uhour = $(this).attr("d-hour"); 19 | var uappname = $(this).attr("d-appname"); 20 | var str = "/exceptiondetail?uDate=" + uhour + "&methodName=" + va + "&appName=" + uappname; 21 | return '' + va + ''; 22 | }, 23 | formatExCount: function(va){ 24 | var uyes = $(this).attr("data-yes"); 25 | var ulas = $(this).attr("data-las"); 26 | // 规则 27 | if(uyes !="0" && ulas !="0"){ 28 | var redexnum=parseInt($("#redEXNum").val()); 29 | if(parseInt(va)/parseInt(uyes)>redexnum || parseInt(va)/parseInt(ulas)>redexnum){ 30 | $(this).parent("tr").addClass("error"); 31 | } 32 | } 33 | 34 | return va; 35 | } 36 | }) 37 | 38 | // params 39 | $(".c-search").bind('click', function () { 40 | var uDate = $(".c-date-select").dropdown('get value'); 41 | var uAppName = $(".c-channel-select").dropdown('get value'); 42 | var uHour = $(".c-time-select").dropdown('get value'); 43 | var uTopNum = $(".c-topnum-select").dropdown('get value'); 44 | $(this).addClass("loading"); 45 | 46 | $.ajax({ 47 | url: "/getexceptiondata", 48 | async: false, 49 | data: { 50 | uDate: uDate, 51 | uAppName: uAppName, 52 | uHour: uHour, 53 | uTopNum: uTopNum 54 | }, 55 | success: function (data) { 56 | if (data == undefined || data == null) { 57 | alert("异常了!"); 58 | } 59 | if(data =="") { 60 | $("#tmp-searched-result-container").html('

没有数据!

'); 61 | return ; 62 | } ; 63 | $("#tmp-searched-result-container").loadTemplate("#tmp-searched-result", data); 64 | $('.c-searched-table').tablesort(); 65 | 66 | $(this).removeClass("loading"); 67 | }, 68 | error: function (errMsg) { 69 | alert("方法失败,请刷新页面试试!"); 70 | $(this).removeClass("loading"); 71 | } 72 | }); 73 | 74 | initBarEcharts(); 75 | 76 | }); 77 | 78 | 79 | }; 80 | var initBarEcharts = function () { 81 | // 路径配置 82 | require.config({ 83 | paths: { 84 | echarts: 'resources/js/echarts' 85 | } 86 | }); 87 | 88 | var asynCharts; 89 | require( 90 | [ 91 | 'echarts', 92 | 'echarts/chart/bar', 93 | 'echarts/chart/line' 94 | ], 95 | function (ec) { 96 | asynCharts = ec.init(document.getElementById('exceptionBarChart')); 97 | asynCharts.showLoading({ 98 | text: "正在努力加载哦……" 99 | }); 100 | 101 | var options = { 102 | title : { 103 | text: "方法异常排行", 104 | subtext: '' 105 | }, 106 | tooltip : { 107 | trigger: 'axis' 108 | }, 109 | legend: { 110 | data:[] 111 | }, 112 | toolbox: { 113 | show: true, 114 | feature: { 115 | showTitle: true, 116 | dataZoom: { 117 | show: true, 118 | title: { 119 | dataZoom: '区域缩放', 120 | dataZoomReset: '区域缩放-后退' 121 | } 122 | }, 123 | magicType: { 124 | show: true, 125 | title: { 126 | line: '折线图', 127 | bar: '柱状图', 128 | pie: '饼状图' 129 | }, 130 | type: ['line', 'bar', 'pie'] 131 | }, 132 | restore: { 133 | show: true, 134 | title: '还原' 135 | }, 136 | saveAsImage: { 137 | show: true, 138 | title: '保存为图片', 139 | type: 'jpge', 140 | lang: '点击保存到本地' 141 | } 142 | 143 | } 144 | }, 145 | calculable : true, 146 | // 横向 147 | xAxis : [ 148 | { 149 | type : 'value', 150 | boundaryGap : [0, 0.01] 151 | } 152 | ], 153 | yAxis : [ 154 | { 155 | type : 'category', 156 | data : [] 157 | } 158 | ], 159 | series : [] 160 | }; 161 | 162 | // ajax 获取数据 163 | $.ajax({ 164 | type: "GET", 165 | url: "/getexceptiondatabar", 166 | data: { 167 | uDate: $(".c-date-select").dropdown('get value'), 168 | uAppName: $(".c-channel-select").dropdown('get value'), 169 | uHour: $(".c-time-select").dropdown('get value'), 170 | uTopNum: $(".c-topnum-select").dropdown('get value') 171 | }, 172 | success: function (data) { 173 | if (data) { 174 | options.yAxis[0].data = data.categoryList; 175 | options.series = data.echartsSeriesList; 176 | options.legend.data = data.legendList; 177 | 178 | asynCharts.hideLoading(); 179 | asynCharts.setOption(options); 180 | }else{ 181 | asynCharts.hideLoading(); 182 | } 183 | }, 184 | error: function (data) { 185 | asynCharts.hideLoading(); 186 | alert("异常咯!") 187 | } 188 | }); 189 | } 190 | ); 191 | }; 192 | initEvent(); 193 | })(); -------------------------------------------------------------------------------- /src/main/webapp/resources/js/jquery.loadTemplate-1.4.4.min.js: -------------------------------------------------------------------------------- 1 | (function(a){var v={},u={},h={};function n(F,B,D){var A=this,z,C,E;B=B||{};E=a.extend(true,{async:true,overwriteCache:false,complete:null,success:null,error:function(){a(this).each(function(){a(this).html(E.errorMessage)})},errorMessage:"There was an error loading the template.",paged:false,pageNo:1,elemPerPage:10,append:false,prepend:false,beforeInsert:null,afterInsert:null,bindingOptions:{ignoreUndefined:false,ignoreNull:false,ignoreEmptyString:false}},D);if(a.type(B)==="array"){return s.call(this,F,B,E)}if(!g(F)){z=a(F);if(typeof F==="string"&&F.indexOf("#")===0){E.isFile=false}}C=E.isFile||(typeof E.isFile==="undefined"&&(typeof z==="undefined"||z.length===0));if(C&&!E.overwriteCache&&v[F]){q(F,A,B,E)}else{if(C&&!E.overwriteCache&&v.hasOwnProperty(F)){c(F,A,B,E)}else{if(C){m(F,A,B,E)}else{o(z,A,B,E)}}}return this}function b(A,z){if(z){h[A]=z}else{h=a.extend(h,A)}}function g(z){return typeof z==="string"&&z.indexOf("/")>-1}function s(I,A,F){F=F||{};var z=this,J=A.length,C=F.prepend&&!F.append,B=0,H=0,D=false,E;if(F.paged){var G=(F.pageNo-1)*F.elemPerPage;A=A.slice(G,G+F.elemPerPage);J=A.length}E=a.extend({},F,{complete:function(){if(this.html){if(C){z.prepend(this.html())}else{z.append(this.html())}}B++;if(B===J||D){if(D&&F&&typeof F.error==="function"){F.error.call(z)}if(F&&typeof F.complete==="function"){F.complete()}}},success:function(){H++;if(H===J){if(F&&typeof F.success==="function"){F.success()}}},error:function(){D=true}});if(!F.append&&!F.prepend){z.html("")}if(C){A.reverse()}a(A).each(function(){var K=a("
");n.call(K,I,this,E);if(D){return false}});return this}function c(C,A,z,B){if(u[C]){u[C].push({data:z,selection:A,settings:B})}else{u[C]=[{data:z,selection:A,settings:B}]}}function q(D,B,A,C){var z=v[D].clone();p.call(B,z,A,C);if(typeof C.success==="function"){C.success()}}function w(){return new Date().getTime()}function x(z){if(z.indexOf("?")!==-1){return z+"&_="+w()}else{return z+"?_="+w()}}function m(D,B,A,C){var z=a("
");v[D]=null;var E=D;if(C.overwriteCache){E=x(E)}a.ajax({url:E,async:C.async,success:function(F){z.html(F);l(z,D,B,A,C)},error:function(){k(D,B,A,C)}})}function o(z,C,B,D){var A=a("
");if(z.is("script")||z.is("template")){z=a.parseHTML(a.trim(z.html()))}A.html(z);p.call(C,A,B,D);if(typeof D.success==="function"){D.success()}}function p(B,z,A){f(B,z,A);a(this).each(function(){var C=a(B.html());if(A.beforeInsert){A.beforeInsert(C)}if(A.append){a(this).append(C)}else{if(A.prepend){a(this).prepend(C)}else{a(this).html(C)}}if(A.afterInsert){A.afterInsert(C)}});if(typeof A.complete==="function"){A.complete.call(a(this))}}function k(C,A,z,B){var D;if(typeof B.error==="function"){B.error.call(A)}a(u[C]).each(function(E,F){if(typeof F.settings.error==="function"){F.settings.error.call(F.selection)}});if(typeof B.complete==="function"){B.complete.call(A)}while(u[C]&&(D=u[C].shift())){if(typeof D.settings.complete==="function"){D.settings.complete.call(D.selection)}}if(typeof u[C]!=="undefined"&&u[C].length>0){u[C]=[]}}function l(z,D,B,A,C){var E;v[D]=z.clone();p.call(B,z,A,C);if(typeof C.success==="function"){C.success.call(B)}while(u[D]&&(E=u[D].shift())){p.call(E.selection,v[D].clone(),E.data,E.settings);if(typeof E.settings.success==="function"){E.settings.success.call(E.selection)}}}function f(B,z,A){z=z||{};t("data-content",B,z,A,function(C,D){C.html(e(C,D,"content",A))});t("data-content-append",B,z,A,function(C,D){C.append(e(C,D,"content",A))});t("data-content-prepend",B,z,A,function(C,D){C.prepend(e(C,D,"content",A))});t("data-content-text",B,z,A,function(C,D){C.text(e(C,D,"content",A))});t("data-src",B,z,A,function(C,D){C.attr("src",e(C,D,"src",A))},function(C){C.remove()});t("data-href",B,z,A,function(C,D){C.attr("href",e(C,D,"href",A))},function(C){C.remove()});t("data-alt",B,z,A,function(C,D){C.attr("alt",e(C,D,"alt",A))});t("data-id",B,z,A,function(C,D){C.attr("id",e(C,D,"id",A))});t("data-value",B,z,A,function(C,D){C.attr("value",e(C,D,"value",A))});t("data-link",B,z,A,function(C,E){var D=a("");D.attr("href",e(C,E,"link",A));D.html(C.html());C.html(D)});t("data-link-wrap",B,z,A,function(C,E){var D=a("");D.attr("href",e(C,E,"link-wrap",A));C.wrap(D)});t("data-options",B,z,A,function(C,D){a(D).each(function(){var E=a("