Enford 5 years ago
parent
commit
1ecd369ea7
39 changed files with 105138 additions and 0 deletions
  1. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/bar.js
  2. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/chord.js
  3. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/eventRiver.js
  4. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/force.js
  5. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/funnel.js
  6. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/gauge.js
  7. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/heatmap.js
  8. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/k.js
  9. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/line.js
  10. 13 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/map.js
  11. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/pie.js
  12. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/radar.js
  13. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/scatter.js
  14. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/tree.js
  15. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/treemap.js
  16. 1 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/venn.js
  17. 2 0
      src/main/webapp/static/echarts-2.2.7/build/dist/chart/wordCloud.js
  18. 35 0
      src/main/webapp/static/echarts-2.2.7/build/dist/echarts-all.js
  19. 20 0
      src/main/webapp/static/echarts-2.2.7/build/dist/echarts.js
  20. 86 0
      src/main/webapp/static/echarts-2.2.7/build/echarts-optimize-conf.js
  21. 648 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/bar.js
  22. 1254 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/chord.js
  23. 399 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/eventRiver.js
  24. 1697 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/force.js
  25. 553 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/funnel.js
  26. 577 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/gauge.js
  27. 286 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/heatmap.js
  28. 325 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/k.js
  29. 817 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/line.js
  30. 17866 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/map.js
  31. 746 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/pie.js
  32. 942 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/radar.js
  33. 1708 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/scatter.js
  34. 625 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/tree.js
  35. 632 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/treemap.js
  36. 686 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/venn.js
  37. 2120 0
      src/main/webapp/static/echarts-2.2.7/build/source/chart/wordCloud.js
  38. 49884 0
      src/main/webapp/static/echarts-2.2.7/build/source/echarts-all.js
  39. 23202 0
      src/main/webapp/static/echarts-2.2.7/build/source/echarts.js

File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/bar.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/chord.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/eventRiver.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/force.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/funnel.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/gauge.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/heatmap.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/k.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/line.js


File diff suppressed because it is too large
+ 13 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/map.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/pie.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/radar.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/scatter.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/tree.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/treemap.js


File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/venn.js


File diff suppressed because it is too large
+ 2 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/chart/wordCloud.js


File diff suppressed because it is too large
+ 35 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/echarts-all.js


File diff suppressed because it is too large
+ 20 - 0
src/main/webapp/static/echarts-2.2.7/build/dist/echarts.js


+ 86 - 0
src/main/webapp/static/echarts-2.2.7/build/echarts-optimize-conf.js

@@ -0,0 +1,86 @@
+exports.modules = {
+    main: {
+        name: 'echarts/echarts',
+        includeShallow: [
+            'echarts/component/dataRange'
+        ]
+    },
+    parts: [
+        {name: 'echarts/chart/line', weight: 100},
+        {name: 'echarts/chart/bar', weight: 100},
+        {name: 'echarts/chart/scatter', weight: 90},
+        {name: 'echarts/chart/k', weight: 30},
+        {name: 'echarts/chart/pie', weight: 90},
+        {name: 'echarts/chart/radar', weight: 30},
+        {name: 'echarts/chart/chord', weight: 30},
+        {name: 'echarts/chart/force', weight: 30},
+        {
+            name: 'echarts/chart/map',
+            weight: 90,
+            includeShallow: [
+                'echarts/util/mapData/geoJson/an_hui_geo',
+                'echarts/util/mapData/geoJson/ao_men_geo',
+                'echarts/util/mapData/geoJson/bei_jing_geo',
+                'echarts/util/mapData/geoJson/china_geo',
+                'echarts/util/mapData/geoJson/chong_qing_geo',
+                'echarts/util/mapData/geoJson/fu_jian_geo',
+                'echarts/util/mapData/geoJson/gan_su_geo',
+                'echarts/util/mapData/geoJson/guang_dong_geo',
+                'echarts/util/mapData/geoJson/guang_xi_geo',
+                'echarts/util/mapData/geoJson/gui_zhou_geo',
+                'echarts/util/mapData/geoJson/hai_nan_geo',
+                'echarts/util/mapData/geoJson/hei_long_jiang_geo',
+                'echarts/util/mapData/geoJson/he_bei_geo',
+                'echarts/util/mapData/geoJson/he_nan_geo',
+                'echarts/util/mapData/geoJson/hu_bei_geo',
+                'echarts/util/mapData/geoJson/hu_nan_geo',
+                'echarts/util/mapData/geoJson/jiang_su_geo',
+                'echarts/util/mapData/geoJson/jiang_xi_geo',
+                'echarts/util/mapData/geoJson/ji_lin_geo',
+                'echarts/util/mapData/geoJson/liao_ning_geo',
+                'echarts/util/mapData/geoJson/nei_meng_gu_geo',
+                'echarts/util/mapData/geoJson/ning_xia_geo',
+                'echarts/util/mapData/geoJson/qing_hai_geo',
+                'echarts/util/mapData/geoJson/shang_hai_geo',
+                'echarts/util/mapData/geoJson/shan_dong_geo',
+                'echarts/util/mapData/geoJson/shan_xi_1_geo',
+                'echarts/util/mapData/geoJson/shan_xi_2_geo',
+                'echarts/util/mapData/geoJson/si_chuan_geo',
+                'echarts/util/mapData/geoJson/tai_wan_geo',
+                'echarts/util/mapData/geoJson/tian_jin_geo',
+                'echarts/util/mapData/geoJson/world_geo',
+                'echarts/util/mapData/geoJson/xiang_gang_geo',
+                'echarts/util/mapData/geoJson/xin_jiang_geo',
+                'echarts/util/mapData/geoJson/xi_zang_geo',
+                'echarts/util/mapData/geoJson/yun_nan_geo',
+                'echarts/util/mapData/geoJson/zhe_jiang_geo'
+            ]
+        },
+        {name: 'echarts/chart/gauge', weight: 30},
+        {name: 'echarts/chart/funnel', weight: 30},
+        {name: 'echarts/chart/eventRiver', weight: 10},
+        {name: 'echarts/chart/venn', weight: 10},
+        {name: 'echarts/chart/treemap', weight: 10},
+        {name: 'echarts/chart/tree', weight: 10},
+        {name: 'echarts/chart/wordCloud', weight: 10},
+        {name: 'echarts/chart/heatmap', weight: 10, includeShallow: [
+            'echarts/layer/heatmap'
+        ]}
+    ]
+};
+
+exports.amd = {
+    baseUrl: process.cwd(),
+    packages: [
+        {
+            name: 'echarts',
+            location: '../src',
+            main: 'echarts'
+        },
+        {
+            name: 'zrender',
+            location: '../../zrender/src',
+            main: 'zrender'
+        }
+    ]
+};

+ 648 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/bar.js

@@ -0,0 +1,648 @@
+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 (require) {
+    var ChartBase = require('./base');
+    var RectangleShape = require('zrender/shape/Rectangle');
+    require('../component/axis');
+    require('../component/grid');
+    require('../component/dataZoom');
+    var ecConfig = require('../config');
+    ecConfig.bar = {
+        zlevel: 0,
+        z: 2,
+        clickable: true,
+        legendHoverLink: true,
+        xAxisIndex: 0,
+        yAxisIndex: 0,
+        barMinHeight: 0,
+        barGap: '30%',
+        barCategoryGap: '20%',
+        itemStyle: {
+            normal: {
+                barBorderColor: '#fff',
+                barBorderRadius: 0,
+                barBorderWidth: 0,
+                label: { show: false }
+            },
+            emphasis: {
+                barBorderColor: '#fff',
+                barBorderRadius: 0,
+                barBorderWidth: 0,
+                label: { show: false }
+            }
+        }
+    };
+    var ecData = require('../util/ecData');
+    var zrUtil = require('zrender/tool/util');
+    var zrColor = require('zrender/tool/color');
+    function Bar(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        this.refresh(option);
+    }
+    Bar.prototype = {
+        type: ecConfig.CHART_TYPE_BAR,
+        _buildShape: function () {
+            this._buildPosition();
+        },
+        _buildNormal: function (seriesArray, maxDataLength, locationMap, xMarkMap, orient) {
+            var series = this.series;
+            var seriesIndex = locationMap[0][0];
+            var serie = series[seriesIndex];
+            var isHorizontal = orient == 'horizontal';
+            var xAxis = this.component.xAxis;
+            var yAxis = this.component.yAxis;
+            var categoryAxis = isHorizontal ? xAxis.getAxis(serie.xAxisIndex) : yAxis.getAxis(serie.yAxisIndex);
+            var valueAxis;
+            var size = this._mapSize(categoryAxis, locationMap);
+            var gap = size.gap;
+            var barGap = size.barGap;
+            var barWidthMap = size.barWidthMap;
+            var barMaxWidthMap = size.barMaxWidthMap;
+            var barWidth = size.barWidth;
+            var barMinHeightMap = size.barMinHeightMap;
+            var barHeight;
+            var curBarWidth;
+            var interval = size.interval;
+            var x;
+            var y;
+            var lastP;
+            var baseP;
+            var lastN;
+            var baseN;
+            var barShape;
+            var data;
+            var value;
+            var islandR = this.deepQuery([
+                this.ecTheme,
+                ecConfig
+            ], 'island.r');
+            for (var i = 0, l = maxDataLength; i < l; i++) {
+                if (categoryAxis.getNameByIndex(i) == null) {
+                    break;
+                }
+                isHorizontal ? x = categoryAxis.getCoordByIndex(i) - gap / 2 : y = categoryAxis.getCoordByIndex(i) + gap / 2;
+                for (var j = 0, k = locationMap.length; j < k; j++) {
+                    var yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0;
+                    var xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0;
+                    valueAxis = isHorizontal ? yAxis.getAxis(yAxisIndex) : xAxis.getAxis(xAxisIndex);
+                    baseP = lastP = baseN = lastN = valueAxis.getCoord(0);
+                    for (var m = 0, n = locationMap[j].length; m < n; m++) {
+                        seriesIndex = locationMap[j][m];
+                        serie = series[seriesIndex];
+                        data = serie.data[i];
+                        value = this.getDataFromOption(data, '-');
+                        xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {
+                            min: Number.POSITIVE_INFINITY,
+                            max: Number.NEGATIVE_INFINITY,
+                            sum: 0,
+                            counter: 0,
+                            average: 0
+                        };
+                        curBarWidth = Math.min(barMaxWidthMap[seriesIndex] || Number.MAX_VALUE, barWidthMap[seriesIndex] || barWidth);
+                        if (value === '-') {
+                            continue;
+                        }
+                        if (value > 0) {
+                            barHeight = m > 0 ? valueAxis.getCoordSize(value) : isHorizontal ? baseP - valueAxis.getCoord(value) : valueAxis.getCoord(value) - baseP;
+                            if (n === 1 && barMinHeightMap[seriesIndex] > barHeight) {
+                                barHeight = barMinHeightMap[seriesIndex];
+                            }
+                            if (isHorizontal) {
+                                lastP -= barHeight;
+                                y = lastP;
+                            } else {
+                                x = lastP;
+                                lastP += barHeight;
+                            }
+                        } else if (value < 0) {
+                            barHeight = m > 0 ? valueAxis.getCoordSize(value) : isHorizontal ? valueAxis.getCoord(value) - baseN : baseN - valueAxis.getCoord(value);
+                            if (n === 1 && barMinHeightMap[seriesIndex] > barHeight) {
+                                barHeight = barMinHeightMap[seriesIndex];
+                            }
+                            if (isHorizontal) {
+                                y = lastN;
+                                lastN += barHeight;
+                            } else {
+                                lastN -= barHeight;
+                                x = lastN;
+                            }
+                        } else {
+                            barHeight = 0;
+                            if (isHorizontal) {
+                                lastP -= barHeight;
+                                y = lastP;
+                            } else {
+                                x = lastP;
+                                lastP += barHeight;
+                            }
+                        }
+                        xMarkMap[seriesIndex][i] = isHorizontal ? x + curBarWidth / 2 : y - curBarWidth / 2;
+                        if (xMarkMap[seriesIndex].min > value) {
+                            xMarkMap[seriesIndex].min = value;
+                            if (isHorizontal) {
+                                xMarkMap[seriesIndex].minY = y;
+                                xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i];
+                            } else {
+                                xMarkMap[seriesIndex].minX = x + barHeight;
+                                xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i];
+                            }
+                        }
+                        if (xMarkMap[seriesIndex].max < value) {
+                            xMarkMap[seriesIndex].max = value;
+                            if (isHorizontal) {
+                                xMarkMap[seriesIndex].maxY = y;
+                                xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i];
+                            } else {
+                                xMarkMap[seriesIndex].maxX = x + barHeight;
+                                xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i];
+                            }
+                        }
+                        xMarkMap[seriesIndex].sum += value;
+                        xMarkMap[seriesIndex].counter++;
+                        if (i % interval === 0) {
+                            barShape = this._getBarItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y - (isHorizontal ? 0 : curBarWidth), isHorizontal ? curBarWidth : barHeight, isHorizontal ? barHeight : curBarWidth, isHorizontal ? 'vertical' : 'horizontal');
+                            this.shapeList.push(new RectangleShape(barShape));
+                        }
+                    }
+                    for (var m = 0, n = locationMap[j].length; m < n; m++) {
+                        seriesIndex = locationMap[j][m];
+                        serie = series[seriesIndex];
+                        data = serie.data[i];
+                        value = this.getDataFromOption(data, '-');
+                        curBarWidth = Math.min(barMaxWidthMap[seriesIndex] || Number.MAX_VALUE, barWidthMap[seriesIndex] || barWidth);
+                        if (value != '-') {
+                            continue;
+                        }
+                        if (this.deepQuery([
+                                data,
+                                serie,
+                                this.option
+                            ], 'calculable')) {
+                            if (isHorizontal) {
+                                lastP -= islandR;
+                                y = lastP;
+                            } else {
+                                x = lastP;
+                                lastP += islandR;
+                            }
+                            barShape = this._getBarItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y - (isHorizontal ? 0 : curBarWidth), isHorizontal ? curBarWidth : islandR, isHorizontal ? islandR : curBarWidth, isHorizontal ? 'vertical' : 'horizontal');
+                            barShape.hoverable = false;
+                            barShape.draggable = false;
+                            barShape.style.lineWidth = 1;
+                            barShape.style.brushType = 'stroke';
+                            barShape.style.strokeColor = serie.calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor;
+                            this.shapeList.push(new RectangleShape(barShape));
+                        }
+                    }
+                    isHorizontal ? x += curBarWidth + barGap : y -= curBarWidth + barGap;
+                }
+            }
+            this._calculMarkMapXY(xMarkMap, locationMap, isHorizontal ? 'y' : 'x');
+        },
+        _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) {
+            return this._buildNormal(seriesArray, maxDataLength, locationMap, xMarkMap, 'horizontal');
+        },
+        _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) {
+            return this._buildNormal(seriesArray, maxDataLength, locationMap, xMarkMap, 'vertical');
+        },
+        _buildOther: function (seriesArray, maxDataLength, locationMap, xMarkMap) {
+            var series = this.series;
+            for (var j = 0, k = locationMap.length; j < k; j++) {
+                for (var m = 0, n = locationMap[j].length; m < n; m++) {
+                    var seriesIndex = locationMap[j][m];
+                    var serie = series[seriesIndex];
+                    var xAxisIndex = serie.xAxisIndex || 0;
+                    var xAxis = this.component.xAxis.getAxis(xAxisIndex);
+                    var baseX = xAxis.getCoord(0);
+                    var yAxisIndex = serie.yAxisIndex || 0;
+                    var yAxis = this.component.yAxis.getAxis(yAxisIndex);
+                    var baseY = yAxis.getCoord(0);
+                    xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {
+                        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 i = 0, l = serie.data.length; i < l; i++) {
+                        var data = serie.data[i];
+                        var value = this.getDataFromOption(data, '-');
+                        if (!(value instanceof Array)) {
+                            continue;
+                        }
+                        var x = xAxis.getCoord(value[0]);
+                        var y = yAxis.getCoord(value[1]);
+                        var queryTarget = [
+                            data,
+                            serie
+                        ];
+                        var barWidth = this.deepQuery(queryTarget, 'barWidth') || 10;
+                        var barHeight = this.deepQuery(queryTarget, 'barHeight');
+                        var orient;
+                        var barShape;
+                        if (barHeight != null) {
+                            orient = 'horizontal';
+                            if (value[0] > 0) {
+                                barWidth = x - baseX;
+                                x -= barWidth;
+                            } else if (value[0] < 0) {
+                                barWidth = baseX - x;
+                            } else {
+                                barWidth = 0;
+                            }
+                            barShape = this._getBarItem(seriesIndex, i, value[0], x, y - barHeight / 2, barWidth, barHeight, orient);
+                        } else {
+                            orient = 'vertical';
+                            if (value[1] > 0) {
+                                barHeight = baseY - y;
+                            } else if (value[1] < 0) {
+                                barHeight = y - baseY;
+                                y -= barHeight;
+                            } else {
+                                barHeight = 0;
+                            }
+                            barShape = this._getBarItem(seriesIndex, i, value[0], x - barWidth / 2, y, barWidth, barHeight, orient);
+                        }
+                        this.shapeList.push(new RectangleShape(barShape));
+                        x = xAxis.getCoord(value[0]);
+                        y = yAxis.getCoord(value[1]);
+                        if (xMarkMap[seriesIndex].min0 > value[0]) {
+                            xMarkMap[seriesIndex].min0 = value[0];
+                            xMarkMap[seriesIndex].minY0 = y;
+                            xMarkMap[seriesIndex].minX0 = x;
+                        }
+                        if (xMarkMap[seriesIndex].max0 < value[0]) {
+                            xMarkMap[seriesIndex].max0 = value[0];
+                            xMarkMap[seriesIndex].maxY0 = y;
+                            xMarkMap[seriesIndex].maxX0 = x;
+                        }
+                        xMarkMap[seriesIndex].sum0 += value[0];
+                        xMarkMap[seriesIndex].counter0++;
+                        if (xMarkMap[seriesIndex].min1 > value[1]) {
+                            xMarkMap[seriesIndex].min1 = value[1];
+                            xMarkMap[seriesIndex].minY1 = y;
+                            xMarkMap[seriesIndex].minX1 = x;
+                        }
+                        if (xMarkMap[seriesIndex].max1 < value[1]) {
+                            xMarkMap[seriesIndex].max1 = value[1];
+                            xMarkMap[seriesIndex].maxY1 = y;
+                            xMarkMap[seriesIndex].maxX1 = x;
+                        }
+                        xMarkMap[seriesIndex].sum1 += value[1];
+                        xMarkMap[seriesIndex].counter1++;
+                    }
+                }
+            }
+            this._calculMarkMapXY(xMarkMap, locationMap, 'xy');
+        },
+        _mapSize: function (categoryAxis, locationMap, ignoreUserDefined) {
+            var res = this._findSpecialBarSzie(locationMap, ignoreUserDefined);
+            var barWidthMap = res.barWidthMap;
+            var barMaxWidthMap = res.barMaxWidthMap;
+            var barMinHeightMap = res.barMinHeightMap;
+            var sBarWidthCounter = res.sBarWidthCounter;
+            var sBarWidthTotal = res.sBarWidthTotal;
+            var barGap = res.barGap;
+            var barCategoryGap = res.barCategoryGap;
+            var gap;
+            var barWidth;
+            var interval = 1;
+            if (locationMap.length != sBarWidthCounter) {
+                if (!ignoreUserDefined) {
+                    gap = typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) ? (categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100).toFixed(2) - 0 : categoryAxis.getGap() - barCategoryGap;
+                    if (typeof barGap === 'string' && barGap.match(/%$/)) {
+                        barGap = parseFloat(barGap) / 100;
+                        barWidth = +((gap - sBarWidthTotal) / ((locationMap.length - 1) * barGap + locationMap.length - sBarWidthCounter)).toFixed(2);
+                        barGap = barWidth * barGap;
+                    } else {
+                        barGap = parseFloat(barGap);
+                        barWidth = +((gap - sBarWidthTotal - barGap * (locationMap.length - 1)) / (locationMap.length - sBarWidthCounter)).toFixed(2);
+                    }
+                    if (barWidth <= 0) {
+                        return this._mapSize(categoryAxis, locationMap, true);
+                    }
+                } else {
+                    gap = categoryAxis.getGap();
+                    barGap = 0;
+                    barWidth = +(gap / locationMap.length).toFixed(2);
+                    if (barWidth <= 0) {
+                        interval = Math.floor(locationMap.length / gap);
+                        barWidth = 1;
+                    }
+                }
+            } else {
+                gap = sBarWidthCounter > 1 ? typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) ? +(categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100).toFixed(2) : categoryAxis.getGap() - barCategoryGap : sBarWidthTotal;
+                barWidth = 0;
+                barGap = sBarWidthCounter > 1 ? +((gap - sBarWidthTotal) / (sBarWidthCounter - 1)).toFixed(2) : 0;
+                if (barGap < 0) {
+                    return this._mapSize(categoryAxis, locationMap, true);
+                }
+            }
+            return this._recheckBarMaxWidth(locationMap, barWidthMap, barMaxWidthMap, barMinHeightMap, gap, barWidth, barGap, interval);
+        },
+        _findSpecialBarSzie: function (locationMap, ignoreUserDefined) {
+            var series = this.series;
+            var barWidthMap = {};
+            var barMaxWidthMap = {};
+            var barMinHeightMap = {};
+            var sBarWidth;
+            var sBarMaxWidth;
+            var sBarWidthCounter = 0;
+            var sBarWidthTotal = 0;
+            var barGap;
+            var barCategoryGap;
+            for (var j = 0, k = locationMap.length; j < k; j++) {
+                var hasFound = {
+                    barWidth: false,
+                    barMaxWidth: false
+                };
+                for (var m = 0, n = locationMap[j].length; m < n; m++) {
+                    var seriesIndex = locationMap[j][m];
+                    var queryTarget = series[seriesIndex];
+                    if (!ignoreUserDefined) {
+                        if (!hasFound.barWidth) {
+                            sBarWidth = this.query(queryTarget, 'barWidth');
+                            if (sBarWidth != null) {
+                                barWidthMap[seriesIndex] = sBarWidth;
+                                sBarWidthTotal += sBarWidth;
+                                sBarWidthCounter++;
+                                hasFound.barWidth = true;
+                                for (var ii = 0, ll = m; ii < ll; ii++) {
+                                    var pSeriesIndex = locationMap[j][ii];
+                                    barWidthMap[pSeriesIndex] = sBarWidth;
+                                }
+                            }
+                        } else {
+                            barWidthMap[seriesIndex] = sBarWidth;
+                        }
+                        if (!hasFound.barMaxWidth) {
+                            sBarMaxWidth = this.query(queryTarget, 'barMaxWidth');
+                            if (sBarMaxWidth != null) {
+                                barMaxWidthMap[seriesIndex] = sBarMaxWidth;
+                                hasFound.barMaxWidth = true;
+                                for (var ii = 0, ll = m; ii < ll; ii++) {
+                                    var pSeriesIndex = locationMap[j][ii];
+                                    barMaxWidthMap[pSeriesIndex] = sBarMaxWidth;
+                                }
+                            }
+                        } else {
+                            barMaxWidthMap[seriesIndex] = sBarMaxWidth;
+                        }
+                    }
+                    barMinHeightMap[seriesIndex] = this.query(queryTarget, 'barMinHeight');
+                    barGap = barGap != null ? barGap : this.query(queryTarget, 'barGap');
+                    barCategoryGap = barCategoryGap != null ? barCategoryGap : this.query(queryTarget, 'barCategoryGap');
+                }
+            }
+            return {
+                barWidthMap: barWidthMap,
+                barMaxWidthMap: barMaxWidthMap,
+                barMinHeightMap: barMinHeightMap,
+                sBarWidth: sBarWidth,
+                sBarMaxWidth: sBarMaxWidth,
+                sBarWidthCounter: sBarWidthCounter,
+                sBarWidthTotal: sBarWidthTotal,
+                barGap: barGap,
+                barCategoryGap: barCategoryGap
+            };
+        },
+        _recheckBarMaxWidth: function (locationMap, barWidthMap, barMaxWidthMap, barMinHeightMap, gap, barWidth, barGap, interval) {
+            for (var j = 0, k = locationMap.length; j < k; j++) {
+                var seriesIndex = locationMap[j][0];
+                if (barMaxWidthMap[seriesIndex] && barMaxWidthMap[seriesIndex] < barWidth) {
+                    gap -= barWidth - barMaxWidthMap[seriesIndex];
+                }
+            }
+            return {
+                barWidthMap: barWidthMap,
+                barMaxWidthMap: barMaxWidthMap,
+                barMinHeightMap: barMinHeightMap,
+                gap: gap,
+                barWidth: barWidth,
+                barGap: barGap,
+                interval: interval
+            };
+        },
+        _getBarItem: function (seriesIndex, dataIndex, name, x, y, width, height, orient) {
+            var series = this.series;
+            var barShape;
+            var serie = series[seriesIndex];
+            var data = serie.data[dataIndex];
+            var defaultColor = this._sIndex2ColorMap[seriesIndex];
+            var queryTarget = [
+                data,
+                serie
+            ];
+            var normal = this.deepMerge(queryTarget, 'itemStyle.normal');
+            var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis');
+            var normalBorderWidth = normal.barBorderWidth;
+            barShape = {
+                zlevel: serie.zlevel,
+                z: serie.z,
+                clickable: this.deepQuery(queryTarget, 'clickable'),
+                style: {
+                    x: x,
+                    y: y,
+                    width: width,
+                    height: height,
+                    brushType: 'both',
+                    color: this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.normal.color') || defaultColor, seriesIndex, dataIndex, data),
+                    radius: normal.barBorderRadius,
+                    lineWidth: normalBorderWidth,
+                    strokeColor: normal.barBorderColor
+                },
+                highlightStyle: {
+                    color: this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), seriesIndex, dataIndex, data),
+                    radius: emphasis.barBorderRadius,
+                    lineWidth: emphasis.barBorderWidth,
+                    strokeColor: emphasis.barBorderColor
+                },
+                _orient: orient
+            };
+            var barShapeStyle = barShape.style;
+            barShape.highlightStyle.color = barShape.highlightStyle.color || (typeof barShapeStyle.color === 'string' ? zrColor.lift(barShapeStyle.color, -0.3) : barShapeStyle.color);
+            barShapeStyle.x = Math.floor(barShapeStyle.x);
+            barShapeStyle.y = Math.floor(barShapeStyle.y);
+            barShapeStyle.height = Math.ceil(barShapeStyle.height);
+            barShapeStyle.width = Math.ceil(barShapeStyle.width);
+            if (normalBorderWidth > 0 && barShapeStyle.height > normalBorderWidth && barShapeStyle.width > normalBorderWidth) {
+                barShapeStyle.y += normalBorderWidth / 2;
+                barShapeStyle.height -= normalBorderWidth;
+                barShapeStyle.x += normalBorderWidth / 2;
+                barShapeStyle.width -= normalBorderWidth;
+            } else {
+                barShapeStyle.brushType = 'fill';
+            }
+            barShape.highlightStyle.textColor = barShape.highlightStyle.color;
+            barShape = this.addLabel(barShape, serie, data, name, orient);
+            var barShapeStyleList = [
+                barShapeStyle,
+                barShape.highlightStyle
+            ];
+            for (var i = 0, l = barShapeStyleList.length; i < l; i++) {
+                var textPosition = barShapeStyleList[i].textPosition;
+                if (textPosition === 'insideLeft' || textPosition === 'insideRight' || textPosition === 'insideTop' || textPosition === 'insideBottom') {
+                    var gap = 5;
+                    switch (textPosition) {
+                    case 'insideLeft':
+                        barShapeStyleList[i].textX = barShapeStyle.x + gap;
+                        barShapeStyleList[i].textY = barShapeStyle.y + barShapeStyle.height / 2;
+                        barShapeStyleList[i].textAlign = 'left';
+                        barShapeStyleList[i].textBaseline = 'middle';
+                        break;
+                    case 'insideRight':
+                        barShapeStyleList[i].textX = barShapeStyle.x + barShapeStyle.width - gap;
+                        barShapeStyleList[i].textY = barShapeStyle.y + barShapeStyle.height / 2;
+                        barShapeStyleList[i].textAlign = 'right';
+                        barShapeStyleList[i].textBaseline = 'middle';
+                        break;
+                    case 'insideTop':
+                        barShapeStyleList[i].textX = barShapeStyle.x + barShapeStyle.width / 2;
+                        barShapeStyleList[i].textY = barShapeStyle.y + gap / 2;
+                        barShapeStyleList[i].textAlign = 'center';
+                        barShapeStyleList[i].textBaseline = 'top';
+                        break;
+                    case 'insideBottom':
+                        barShapeStyleList[i].textX = barShapeStyle.x + barShapeStyle.width / 2;
+                        barShapeStyleList[i].textY = barShapeStyle.y + barShapeStyle.height - gap / 2;
+                        barShapeStyleList[i].textAlign = 'center';
+                        barShapeStyleList[i].textBaseline = 'bottom';
+                        break;
+                    }
+                    barShapeStyleList[i].textPosition = 'specific';
+                    barShapeStyleList[i].textColor = barShapeStyleList[i].textColor || '#fff';
+                }
+            }
+            if (this.deepQuery([
+                    data,
+                    serie,
+                    this.option
+                ], 'calculable')) {
+                this.setCalculable(barShape);
+                barShape.draggable = true;
+            }
+            ecData.pack(barShape, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, name);
+            return barShape;
+        },
+        getMarkCoord: function (seriesIndex, mpData) {
+            var serie = this.series[seriesIndex];
+            var xMarkMap = this.xMarkMap[seriesIndex];
+            var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex);
+            var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex);
+            var dataIndex;
+            var pos;
+            if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) {
+                var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : xMarkMap.maxX0 != null ? '1' : '';
+                pos = [
+                    xMarkMap[mpData.type + 'X' + valueIndex],
+                    xMarkMap[mpData.type + 'Y' + valueIndex],
+                    xMarkMap[mpData.type + 'Line' + valueIndex],
+                    xMarkMap[mpData.type + valueIndex]
+                ];
+            } else if (xMarkMap.isHorizontal) {
+                dataIndex = typeof mpData.xAxis === 'string' && xAxis.getIndexByName ? xAxis.getIndexByName(mpData.xAxis) : mpData.xAxis || 0;
+                var x = xMarkMap[dataIndex];
+                x = x != null ? x : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0);
+                pos = [
+                    x,
+                    yAxis.getCoord(mpData.yAxis || 0)
+                ];
+            } else {
+                dataIndex = typeof mpData.yAxis === 'string' && yAxis.getIndexByName ? yAxis.getIndexByName(mpData.yAxis) : mpData.yAxis || 0;
+                var y = xMarkMap[dataIndex];
+                y = y != null ? y : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0);
+                pos = [
+                    xAxis.getCoord(mpData.xAxis || 0),
+                    y
+                ];
+            }
+            return pos;
+        },
+        refresh: function (newOption) {
+            if (newOption) {
+                this.option = newOption;
+                this.series = newOption.series;
+            }
+            this.backupShapeList();
+            this._buildShape();
+        },
+        addDataAnimation: function (params, done) {
+            var series = this.series;
+            var aniMap = {};
+            for (var i = 0, l = params.length; i < l; i++) {
+                aniMap[params[i][0]] = params[i];
+            }
+            var x;
+            var dx;
+            var y;
+            var dy;
+            var serie;
+            var seriesIndex;
+            var dataIndex;
+            var aniCount = 0;
+            function animationDone() {
+                aniCount--;
+                if (aniCount === 0) {
+                    done && done();
+                }
+            }
+            for (var i = this.shapeList.length - 1; i >= 0; i--) {
+                seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex');
+                if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) {
+                    if (this.shapeList[i].type === 'rectangle') {
+                        dataIndex = ecData.get(this.shapeList[i], 'dataIndex');
+                        serie = series[seriesIndex];
+                        if (aniMap[seriesIndex][2] && dataIndex === serie.data.length - 1) {
+                            this.zr.delShape(this.shapeList[i].id);
+                            continue;
+                        } else if (!aniMap[seriesIndex][2] && dataIndex === 0) {
+                            this.zr.delShape(this.shapeList[i].id);
+                            continue;
+                        }
+                        if (this.shapeList[i]._orient === 'horizontal') {
+                            dy = this.component.yAxis.getAxis(serie.yAxisIndex || 0).getGap();
+                            y = aniMap[seriesIndex][2] ? -dy : dy;
+                            x = 0;
+                        } else {
+                            dx = this.component.xAxis.getAxis(serie.xAxisIndex || 0).getGap();
+                            x = aniMap[seriesIndex][2] ? dx : -dx;
+                            y = 0;
+                        }
+                        this.shapeList[i].position = [
+                            0,
+                            0
+                        ];
+                        aniCount++;
+                        this.zr.animate(this.shapeList[i].id, '').when(this.query(this.option, 'animationDurationUpdate'), {
+                            position: [
+                                x,
+                                y
+                            ]
+                        }).done(animationDone).start();
+                    }
+                }
+            }
+            if (!aniCount) {
+                done && done();
+            }
+        }
+    };
+    zrUtil.inherits(Bar, ChartBase);
+    require('../chart').define('bar', Bar);
+    return Bar;
+});

File diff suppressed because it is too large
+ 1254 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/chord.js


+ 399 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/eventRiver.js

@@ -0,0 +1,399 @@
+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 (require) {
+    var ChartBase = require('./base');
+    var eventRiverLayout = require('../layout/eventRiver');
+    var PolygonShape = require('zrender/shape/Polygon');
+    require('../component/axis');
+    require('../component/grid');
+    require('../component/dataZoom');
+    var ecConfig = require('../config');
+    ecConfig.eventRiver = {
+        zlevel: 0,
+        z: 2,
+        clickable: true,
+        legendHoverLink: true,
+        itemStyle: {
+            normal: {
+                borderColor: 'rgba(0,0,0,0)',
+                borderWidth: 1,
+                label: {
+                    show: true,
+                    position: 'inside',
+                    formatter: '{b}'
+                }
+            },
+            emphasis: {
+                borderColor: 'rgba(0,0,0,0)',
+                borderWidth: 1,
+                label: { show: true }
+            }
+        }
+    };
+    var ecData = require('../util/ecData');
+    var ecDate = require('../util/date');
+    var zrUtil = require('zrender/tool/util');
+    var zrColor = require('zrender/tool/color');
+    function EventRiver(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        var self = this;
+        self._ondragend = function () {
+            self.isDragend = true;
+        };
+        this.refresh(option);
+    }
+    EventRiver.prototype = {
+        type: ecConfig.CHART_TYPE_EVENTRIVER,
+        _buildShape: function () {
+            var series = this.series;
+            this.selectedMap = {};
+            this._dataPreprocessing();
+            var legend = this.component.legend;
+            var eventRiverSeries = [];
+            for (var i = 0; i < series.length; i++) {
+                if (series[i].type === this.type) {
+                    series[i] = this.reformOption(series[i]);
+                    this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink;
+                    var serieName = series[i].name || '';
+                    this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true;
+                    if (!this.selectedMap[serieName]) {
+                        continue;
+                    }
+                    this.buildMark(i);
+                    eventRiverSeries.push(this.series[i]);
+                }
+            }
+            eventRiverLayout(eventRiverSeries, this._intervalX, this.component.grid.getArea());
+            this._drawEventRiver();
+            this.addShapeList();
+        },
+        _dataPreprocessing: function () {
+            var series = this.series;
+            var xAxis;
+            var evolutionList;
+            for (var i = 0, iLen = series.length; i < iLen; i++) {
+                if (series[i].type === this.type) {
+                    xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex || 0);
+                    for (var j = 0, jLen = series[i].data.length; j < jLen; j++) {
+                        evolutionList = series[i].data[j].evolution;
+                        for (var k = 0, kLen = evolutionList.length; k < kLen; k++) {
+                            evolutionList[k].timeScale = xAxis.getCoord(ecDate.getNewDate(evolutionList[k].time) - 0);
+                            evolutionList[k].valueScale = Math.pow(evolutionList[k].value, 0.8);
+                        }
+                    }
+                }
+            }
+            this._intervalX = Math.round(this.component.grid.getWidth() / 40);
+        },
+        _drawEventRiver: function () {
+            var series = this.series;
+            for (var i = 0; i < series.length; i++) {
+                var serieName = series[i].name || '';
+                if (series[i].type === this.type && this.selectedMap[serieName]) {
+                    for (var j = 0; j < series[i].data.length; j++) {
+                        this._drawEventBubble(series[i].data[j], i, j);
+                    }
+                }
+            }
+        },
+        _drawEventBubble: function (oneEvent, seriesIndex, dataIndex) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var serieName = serie.name || '';
+            var data = serie.data[dataIndex];
+            var queryTarget = [
+                data,
+                serie
+            ];
+            var legend = this.component.legend;
+            var defaultColor = legend ? legend.getColor(serieName) : this.zr.getColor(seriesIndex);
+            var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {};
+            var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {};
+            var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor;
+            var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor);
+            var pts = this._calculateControlPoints(oneEvent);
+            var eventBubbleShape = {
+                zlevel: serie.zlevel,
+                z: serie.z,
+                clickable: this.deepQuery(queryTarget, 'clickable'),
+                style: {
+                    pointList: pts,
+                    smooth: 'spline',
+                    brushType: 'both',
+                    lineJoin: 'round',
+                    color: normalColor,
+                    lineWidth: normal.borderWidth,
+                    strokeColor: normal.borderColor
+                },
+                highlightStyle: {
+                    color: emphasisColor,
+                    lineWidth: emphasis.borderWidth,
+                    strokeColor: emphasis.borderColor
+                },
+                draggable: 'vertical',
+                ondragend: this._ondragend
+            };
+            eventBubbleShape = new PolygonShape(eventBubbleShape);
+            this.addLabel(eventBubbleShape, serie, data, oneEvent.name);
+            ecData.pack(eventBubbleShape, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name);
+            this.shapeList.push(eventBubbleShape);
+        },
+        _calculateControlPoints: function (oneEvent) {
+            var intervalX = this._intervalX;
+            var posY = oneEvent.y;
+            var evolution = oneEvent.evolution;
+            var n = evolution.length;
+            if (n < 1) {
+                return;
+            }
+            var time = [];
+            var value = [];
+            for (var i = 0; i < n; i++) {
+                time.push(evolution[i].timeScale);
+                value.push(evolution[i].valueScale);
+            }
+            var pts = [];
+            pts.push([
+                time[0],
+                posY
+            ]);
+            var i = 0;
+            for (i = 0; i < n - 1; i++) {
+                pts.push([
+                    (time[i] + time[i + 1]) / 2,
+                    value[i] / -2 + posY
+                ]);
+            }
+            pts.push([
+                (time[i] + (time[i] + intervalX)) / 2,
+                value[i] / -2 + posY
+            ]);
+            pts.push([
+                time[i] + intervalX,
+                posY
+            ]);
+            pts.push([
+                (time[i] + (time[i] + intervalX)) / 2,
+                value[i] / 2 + posY
+            ]);
+            for (i = n - 1; i > 0; i--) {
+                pts.push([
+                    (time[i] + time[i - 1]) / 2,
+                    value[i - 1] / 2 + posY
+                ]);
+            }
+            return pts;
+        },
+        ondragend: function (param, status) {
+            if (!this.isDragend || !param.target) {
+                return;
+            }
+            status.dragOut = true;
+            status.dragIn = true;
+            status.needRefresh = false;
+            this.isDragend = false;
+        },
+        refresh: function (newOption) {
+            if (newOption) {
+                this.option = newOption;
+                this.series = newOption.series;
+            }
+            this.backupShapeList();
+            this._buildShape();
+        }
+    };
+    zrUtil.inherits(EventRiver, ChartBase);
+    require('../chart').define('eventRiver', EventRiver);
+    return EventRiver;
+});define('echarts/layout/eventRiver', ['require'], function (require) {
+    function eventRiverLayout(series, intervalX, area) {
+        var space = 4;
+        var scale = intervalX;
+        function importanceSort(a, b) {
+            var x = a.importance;
+            var y = b.importance;
+            return x > y ? -1 : x < y ? 1 : 0;
+        }
+        function indexOf(array, value) {
+            if (array.indexOf) {
+                return array.indexOf(value);
+            }
+            for (var i = 0, len = array.length; i < len; i++) {
+                if (array[i] === value) {
+                    return i;
+                }
+            }
+            return -1;
+        }
+        for (var i = 0; i < series.length; i++) {
+            for (var j = 0; j < series[i].data.length; j++) {
+                if (series[i].data[j].weight == null) {
+                    series[i].data[j].weight = 1;
+                }
+                var importance = 0;
+                for (var k = 0; k < series[i].data[j].evolution.length; k++) {
+                    importance += series[i].data[j].evolution[k].valueScale;
+                }
+                series[i].data[j].importance = importance * series[i].data[j].weight;
+            }
+            series[i].data.sort(importanceSort);
+        }
+        for (var i = 0; i < series.length; i++) {
+            if (series[i].weight == null) {
+                series[i].weight = 1;
+            }
+            var importance = 0;
+            for (var j = 0; j < series[i].data.length; j++) {
+                importance += series[i].data[j].weight;
+            }
+            series[i].importance = importance * series[i].weight;
+        }
+        series.sort(importanceSort);
+        var minTime = Number.MAX_VALUE;
+        var maxTime = 0;
+        for (var i = 0; i < series.length; i++) {
+            for (var j = 0; j < series[i].data.length; j++) {
+                for (var k = 0; k < series[i].data[j].evolution.length; k++) {
+                    var time = series[i].data[j].evolution[k].timeScale;
+                    minTime = Math.min(minTime, time);
+                    maxTime = Math.max(maxTime, time);
+                }
+            }
+        }
+        minTime = ~~minTime;
+        maxTime = ~~maxTime;
+        var flagForOffset = function () {
+            var length = maxTime - minTime + 1 + ~~intervalX;
+            if (length <= 0) {
+                return [0];
+            }
+            var result = [];
+            while (length--) {
+                result.push(0);
+            }
+            return result;
+        }();
+        var flagForPos = flagForOffset.slice(0);
+        var bubbleData = [];
+        var totalMaxy = 0;
+        var totalOffset = 0;
+        for (var i = 0; i < series.length; i++) {
+            for (var j = 0; j < series[i].data.length; j++) {
+                var e = series[i].data[j];
+                e.time = [];
+                e.value = [];
+                var tmp;
+                var maxy = 0;
+                for (var k = 0; k < series[i].data[j].evolution.length; k++) {
+                    tmp = series[i].data[j].evolution[k];
+                    e.time.push(tmp.timeScale);
+                    e.value.push(tmp.valueScale);
+                    maxy = Math.max(maxy, tmp.valueScale);
+                }
+                bubbleBound(e, intervalX, minTime);
+                e.y = findLocation(flagForPos, e, function (e, index) {
+                    return e.ypx[index];
+                });
+                e._offset = findLocation(flagForOffset, e, function () {
+                    return space;
+                });
+                totalMaxy = Math.max(totalMaxy, e.y + maxy);
+                totalOffset = Math.max(totalOffset, e._offset);
+                bubbleData.push(e);
+            }
+        }
+        scaleY(bubbleData, area, totalMaxy, totalOffset);
+    }
+    function scaleY(bubbleData, area, maxY, offset) {
+        var height = area.height;
+        var offsetScale = offset / height > 0.5 ? 0.5 : 1;
+        var yBase = area.y;
+        var yScale = (area.height - offset) / maxY;
+        for (var i = 0, length = bubbleData.length; i < length; i++) {
+            var e = bubbleData[i];
+            e.y = yBase + yScale * e.y + e._offset * offsetScale;
+            delete e.time;
+            delete e.value;
+            delete e.xpx;
+            delete e.ypx;
+            delete e._offset;
+            var evolutionList = e.evolution;
+            for (var k = 0, klen = evolutionList.length; k < klen; k++) {
+                evolutionList[k].valueScale *= yScale;
+            }
+        }
+    }
+    function line(x0, y0, x1, y1) {
+        if (x0 === x1) {
+            throw new Error('x0 is equal with x1!!!');
+        }
+        if (y0 === y1) {
+            return function () {
+                return y0;
+            };
+        }
+        var k = (y0 - y1) / (x0 - x1);
+        var b = (y1 * x0 - y0 * x1) / (x0 - x1);
+        return function (x) {
+            return k * x + b;
+        };
+    }
+    function bubbleBound(e, intervalX, minX) {
+        var space = ~~intervalX;
+        var length = e.time.length;
+        e.xpx = [];
+        e.ypx = [];
+        var i = 0;
+        var x0 = 0;
+        var x1 = 0;
+        var y0 = 0;
+        var y1 = 0;
+        var newline;
+        for (; i < length; i++) {
+            x0 = ~~e.time[i];
+            y0 = e.value[i] / 2;
+            if (i === length - 1) {
+                x1 = x0 + space;
+                y1 = 0;
+            } else {
+                x1 = ~~e.time[i + 1];
+                y1 = e.value[i + 1] / 2;
+            }
+            newline = line(x0, y0, x1, y1);
+            for (var x = x0; x < x1; x++) {
+                e.xpx.push(x - minX);
+                e.ypx.push(newline(x));
+            }
+        }
+        e.xpx.push(x1 - minX);
+        e.ypx.push(y1);
+    }
+    function findLocation(flags, e, yvalue) {
+        var pos = 0;
+        var length = e.xpx.length;
+        var i = 0;
+        var y;
+        for (; i < length; i++) {
+            y = yvalue(e, i);
+            pos = Math.max(pos, y + flags[e.xpx[i]]);
+        }
+        for (i = 0; i < length; i++) {
+            y = yvalue(e, i);
+            flags[e.xpx[i]] = pos + y;
+        }
+        return pos;
+    }
+    return eventRiverLayout;
+});

File diff suppressed because it is too large
+ 1697 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/force.js


+ 553 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/funnel.js

@@ -0,0 +1,553 @@
+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 (require) {
+    var ChartBase = require('./base');
+    var TextShape = require('zrender/shape/Text');
+    var LineShape = require('zrender/shape/Line');
+    var PolygonShape = require('zrender/shape/Polygon');
+    var ecConfig = require('../config');
+    ecConfig.funnel = {
+        zlevel: 0,
+        z: 2,
+        clickable: true,
+        legendHoverLink: true,
+        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: true,
+                    position: 'outer'
+                },
+                labelLine: {
+                    show: true,
+                    length: 10,
+                    lineStyle: {
+                        width: 1,
+                        type: 'solid'
+                    }
+                }
+            },
+            emphasis: {
+                borderColor: 'rgba(0,0,0,0)',
+                borderWidth: 1,
+                label: { show: true },
+                labelLine: { show: true }
+            }
+        }
+    };
+    var ecData = require('../util/ecData');
+    var number = require('../util/number');
+    var zrUtil = require('zrender/tool/util');
+    var zrColor = require('zrender/tool/color');
+    var zrArea = require('zrender/tool/area');
+    function Funnel(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        this.refresh(option);
+    }
+    Funnel.prototype = {
+        type: ecConfig.CHART_TYPE_FUNNEL,
+        _buildShape: function () {
+            var series = this.series;
+            var legend = this.component.legend;
+            this._paramsMap = {};
+            this._selected = {};
+            this.selectedMap = {};
+            var serieName;
+            for (var i = 0, l = series.length; i < l; i++) {
+                if (series[i].type === ecConfig.CHART_TYPE_FUNNEL) {
+                    series[i] = this.reformOption(series[i]);
+                    this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink;
+                    serieName = series[i].name || '';
+                    this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true;
+                    if (!this.selectedMap[serieName]) {
+                        continue;
+                    }
+                    this._buildSingleFunnel(i);
+                    this.buildMark(i);
+                }
+            }
+            this.addShapeList();
+        },
+        _buildSingleFunnel: function (seriesIndex) {
+            var legend = this.component.legend;
+            var serie = this.series[seriesIndex];
+            var data = this._mapData(seriesIndex);
+            var location = this._getLocation(seriesIndex);
+            this._paramsMap[seriesIndex] = {
+                location: location,
+                data: data
+            };
+            var itemName;
+            var total = 0;
+            var selectedData = [];
+            for (var i = 0, l = data.length; i < l; i++) {
+                itemName = data[i].name;
+                this.selectedMap[itemName] = legend ? legend.isSelected(itemName) : true;
+                if (this.selectedMap[itemName] && !isNaN(data[i].value)) {
+                    selectedData.push(data[i]);
+                    total++;
+                }
+            }
+            if (total === 0) {
+                return;
+            }
+            var funnelCase = this._buildFunnelCase(seriesIndex);
+            var align = serie.funnelAlign;
+            var gap = serie.gap;
+            var height = total > 1 ? (location.height - (total - 1) * gap) / total : location.height;
+            var width;
+            var lastY = location.y;
+            var lastWidth = serie.sort === 'descending' ? this._getItemWidth(seriesIndex, selectedData[0].value) : number.parsePercent(serie.minSize, location.width);
+            var next = serie.sort === 'descending' ? 1 : 0;
+            var centerX = location.centerX;
+            var pointList = [];
+            var x;
+            var polygon;
+            var lastPolygon;
+            for (var i = 0, l = selectedData.length; i < l; i++) {
+                itemName = selectedData[i].name;
+                if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) {
+                    width = i <= l - 2 ? this._getItemWidth(seriesIndex, selectedData[i + next].value) : serie.sort === 'descending' ? number.parsePercent(serie.minSize, location.width) : number.parsePercent(serie.maxSize, location.width);
+                    switch (align) {
+                    case 'left':
+                        x = location.x;
+                        break;
+                    case 'right':
+                        x = location.x + location.width - lastWidth;
+                        break;
+                    default:
+                        x = centerX - lastWidth / 2;
+                    }
+                    polygon = this._buildItem(seriesIndex, selectedData[i]._index, legend ? legend.getColor(itemName) : this.zr.getColor(selectedData[i]._index), x, lastY, lastWidth, width, height, align);
+                    lastY += height + gap;
+                    lastPolygon = polygon.style.pointList;
+                    pointList.unshift([
+                        lastPolygon[0][0] - 10,
+                        lastPolygon[0][1]
+                    ]);
+                    pointList.push([
+                        lastPolygon[1][0] + 10,
+                        lastPolygon[1][1]
+                    ]);
+                    if (i === 0) {
+                        if (lastWidth === 0) {
+                            lastPolygon = pointList.pop();
+                            align == 'center' && (pointList[0][0] += 10);
+                            align == 'right' && (pointList[0][0] = lastPolygon[0]);
+                            pointList[0][1] -= align == 'center' ? 10 : 15;
+                            if (l == 1) {
+                                lastPolygon = polygon.style.pointList;
+                            }
+                        } else {
+                            pointList[pointList.length - 1][1] -= 5;
+                            pointList[0][1] -= 5;
+                        }
+                    }
+                    lastWidth = width;
+                }
+            }
+            if (funnelCase) {
+                pointList.unshift([
+                    lastPolygon[3][0] - 10,
+                    lastPolygon[3][1]
+                ]);
+                pointList.push([
+                    lastPolygon[2][0] + 10,
+                    lastPolygon[2][1]
+                ]);
+                if (lastWidth === 0) {
+                    lastPolygon = pointList.pop();
+                    align == 'center' && (pointList[0][0] += 10);
+                    align == 'right' && (pointList[0][0] = lastPolygon[0]);
+                    pointList[0][1] += align == 'center' ? 10 : 15;
+                } else {
+                    pointList[pointList.length - 1][1] += 5;
+                    pointList[0][1] += 5;
+                }
+                funnelCase.style.pointList = pointList;
+            }
+        },
+        _buildFunnelCase: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            if (this.deepQuery([
+                    serie,
+                    this.option
+                ], 'calculable')) {
+                var location = this._paramsMap[seriesIndex].location;
+                var gap = 10;
+                var funnelCase = {
+                    hoverable: false,
+                    style: {
+                        pointListd: [
+                            [
+                                location.x - gap,
+                                location.y - gap
+                            ],
+                            [
+                                location.x + location.width + gap,
+                                location.y - gap
+                            ],
+                            [
+                                location.x + location.width + gap,
+                                location.y + location.height + gap
+                            ],
+                            [
+                                location.x - gap,
+                                location.y + location.height + gap
+                            ]
+                        ],
+                        brushType: 'stroke',
+                        lineWidth: 1,
+                        strokeColor: serie.calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor
+                    }
+                };
+                ecData.pack(funnelCase, serie, seriesIndex, undefined, -1);
+                this.setCalculable(funnelCase);
+                funnelCase = new PolygonShape(funnelCase);
+                this.shapeList.push(funnelCase);
+                return funnelCase;
+            }
+        },
+        _getLocation: function (seriesIndex) {
+            var gridOption = this.series[seriesIndex];
+            var zrWidth = this.zr.getWidth();
+            var zrHeight = this.zr.getHeight();
+            var x = this.parsePercent(gridOption.x, zrWidth);
+            var y = this.parsePercent(gridOption.y, zrHeight);
+            var width = gridOption.width == null ? zrWidth - x - this.parsePercent(gridOption.x2, zrWidth) : this.parsePercent(gridOption.width, zrWidth);
+            return {
+                x: x,
+                y: y,
+                width: width,
+                height: gridOption.height == null ? zrHeight - y - this.parsePercent(gridOption.y2, zrHeight) : this.parsePercent(gridOption.height, zrHeight),
+                centerX: x + width / 2
+            };
+        },
+        _mapData: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            var funnelData = zrUtil.clone(serie.data);
+            for (var i = 0, l = funnelData.length; i < l; i++) {
+                funnelData[i]._index = i;
+            }
+            function numDescending(a, b) {
+                if (a.value === '-') {
+                    return 1;
+                } else if (b.value === '-') {
+                    return -1;
+                }
+                return b.value - a.value;
+            }
+            function numAscending(a, b) {
+                return -numDescending(a, b);
+            }
+            if (serie.sort != 'none') {
+                funnelData.sort(serie.sort === 'descending' ? numDescending : numAscending);
+            }
+            return funnelData;
+        },
+        _buildItem: function (seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var data = serie.data[dataIndex];
+            var polygon = this.getPolygon(seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align);
+            ecData.pack(polygon, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name);
+            this.shapeList.push(polygon);
+            var label = this.getLabel(seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align);
+            ecData.pack(label, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name);
+            this.shapeList.push(label);
+            if (!this._needLabel(serie, data, false)) {
+                label.invisible = true;
+            }
+            var labelLine = this.getLabelLine(seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align);
+            this.shapeList.push(labelLine);
+            if (!this._needLabelLine(serie, data, false)) {
+                labelLine.invisible = true;
+            }
+            var polygonHoverConnect = [];
+            var labelHoverConnect = [];
+            if (this._needLabelLine(serie, data, true)) {
+                polygonHoverConnect.push(labelLine.id);
+                labelHoverConnect.push(labelLine.id);
+            }
+            if (this._needLabel(serie, data, true)) {
+                polygonHoverConnect.push(label.id);
+                labelHoverConnect.push(polygon.id);
+            }
+            polygon.hoverConnect = polygonHoverConnect;
+            label.hoverConnect = labelHoverConnect;
+            return polygon;
+        },
+        _getItemWidth: function (seriesIndex, value) {
+            var serie = this.series[seriesIndex];
+            var location = this._paramsMap[seriesIndex].location;
+            var min = serie.min;
+            var max = serie.max;
+            var minSize = number.parsePercent(serie.minSize, location.width);
+            var maxSize = number.parsePercent(serie.maxSize, location.width);
+            return (value - min) * (maxSize - minSize) / (max - min) + minSize;
+        },
+        getPolygon: function (seriesIndex, dataIndex, defaultColor, xLT, y, topWidth, bottomWidth, height, align) {
+            var serie = this.series[seriesIndex];
+            var data = serie.data[dataIndex];
+            var queryTarget = [
+                data,
+                serie
+            ];
+            var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {};
+            var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {};
+            var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor;
+            var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor);
+            var xLB;
+            switch (align) {
+            case 'left':
+                xLB = xLT;
+                break;
+            case 'right':
+                xLB = xLT + (topWidth - bottomWidth);
+                break;
+            default:
+                xLB = xLT + (topWidth - bottomWidth) / 2;
+                break;
+            }
+            var polygon = {
+                zlevel: serie.zlevel,
+                z: serie.z,
+                clickable: this.deepQuery(queryTarget, 'clickable'),
+                style: {
+                    pointList: [
+                        [
+                            xLT,
+                            y
+                        ],
+                        [
+                            xLT + topWidth,
+                            y
+                        ],
+                        [
+                            xLB + bottomWidth,
+                            y + height
+                        ],
+                        [
+                            xLB,
+                            y + height
+                        ]
+                    ],
+                    brushType: 'both',
+                    color: normalColor,
+                    lineWidth: normal.borderWidth,
+                    strokeColor: normal.borderColor
+                },
+                highlightStyle: {
+                    color: emphasisColor,
+                    lineWidth: emphasis.borderWidth,
+                    strokeColor: emphasis.borderColor
+                }
+            };
+            if (this.deepQuery([
+                    data,
+                    serie,
+                    this.option
+                ], 'calculable')) {
+                this.setCalculable(polygon);
+                polygon.draggable = true;
+            }
+            return new PolygonShape(polygon);
+        },
+        getLabel: function (seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) {
+            var serie = this.series[seriesIndex];
+            var data = serie.data[dataIndex];
+            var location = this._paramsMap[seriesIndex].location;
+            var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle);
+            var status = 'normal';
+            var labelControl = itemStyle[status].label;
+            var textStyle = labelControl.textStyle || {};
+            var lineLength = itemStyle[status].labelLine.length;
+            var text = this.getLabelText(seriesIndex, dataIndex, status);
+            var textFont = this.getFont(textStyle);
+            var textAlign;
+            var textColor = defaultColor;
+            labelControl.position = labelControl.position || itemStyle.normal.label.position;
+            if (labelControl.position === 'inner' || labelControl.position === 'inside' || labelControl.position === 'center') {
+                textAlign = align;
+                textColor = Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont) ? '#fff' : zrColor.reverse(defaultColor);
+            } else if (labelControl.position === 'left') {
+                textAlign = 'right';
+            } else {
+                textAlign = 'left';
+            }
+            var textShape = {
+                zlevel: serie.zlevel,
+                z: serie.z + 1,
+                style: {
+                    x: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align),
+                    y: y + height / 2,
+                    color: textStyle.color || textColor,
+                    text: text,
+                    textAlign: textStyle.align || textAlign,
+                    textBaseline: textStyle.baseline || 'middle',
+                    textFont: textFont
+                }
+            };
+            status = 'emphasis';
+            labelControl = itemStyle[status].label || labelControl;
+            textStyle = labelControl.textStyle || textStyle;
+            lineLength = itemStyle[status].labelLine.length || lineLength;
+            labelControl.position = labelControl.position || itemStyle.normal.label.position;
+            text = this.getLabelText(seriesIndex, dataIndex, status);
+            textFont = this.getFont(textStyle);
+            textColor = defaultColor;
+            if (labelControl.position === 'inner' || labelControl.position === 'inside' || labelControl.position === 'center') {
+                textAlign = align;
+                textColor = Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont) ? '#fff' : zrColor.reverse(defaultColor);
+            } else if (labelControl.position === 'left') {
+                textAlign = 'right';
+            } else {
+                textAlign = 'left';
+            }
+            textShape.highlightStyle = {
+                x: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align),
+                color: textStyle.color || textColor,
+                text: text,
+                textAlign: textStyle.align || textAlign,
+                textFont: textFont,
+                brushType: 'fill'
+            };
+            return new TextShape(textShape);
+        },
+        getLabelText: function (seriesIndex, dataIndex, status) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var data = serie.data[dataIndex];
+            var formatter = this.deepQuery([
+                data,
+                serie
+            ], 'itemStyle.' + status + '.label.formatter');
+            if (formatter) {
+                if (typeof formatter === 'function') {
+                    return formatter.call(this.myChart, {
+                        seriesIndex: seriesIndex,
+                        seriesName: serie.name || '',
+                        series: serie,
+                        dataIndex: dataIndex,
+                        data: data,
+                        name: data.name,
+                        value: data.value
+                    });
+                } else if (typeof formatter === 'string') {
+                    formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{a0}', serie.name).replace('{b0}', data.name).replace('{c0}', data.value);
+                    return formatter;
+                }
+            } else {
+                return data.name;
+            }
+        },
+        getLabelLine: function (seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) {
+            var serie = this.series[seriesIndex];
+            var data = serie.data[dataIndex];
+            var location = this._paramsMap[seriesIndex].location;
+            var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle);
+            var status = 'normal';
+            var labelLineControl = itemStyle[status].labelLine;
+            var lineLength = itemStyle[status].labelLine.length;
+            var lineStyle = labelLineControl.lineStyle || {};
+            var labelControl = itemStyle[status].label;
+            labelControl.position = labelControl.position || itemStyle.normal.label.position;
+            var lineShape = {
+                zlevel: serie.zlevel,
+                z: serie.z + 1,
+                hoverable: false,
+                style: {
+                    xStart: this._getLabelLineStartPoint(x, location, topWidth, bottomWidth, align),
+                    yStart: y + height / 2,
+                    xEnd: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align),
+                    yEnd: y + height / 2,
+                    strokeColor: lineStyle.color || defaultColor,
+                    lineType: lineStyle.type,
+                    lineWidth: lineStyle.width
+                }
+            };
+            status = 'emphasis';
+            labelLineControl = itemStyle[status].labelLine || labelLineControl;
+            lineLength = itemStyle[status].labelLine.length || lineLength;
+            lineStyle = labelLineControl.lineStyle || lineStyle;
+            labelControl = itemStyle[status].label || labelControl;
+            labelControl.position = labelControl.position;
+            lineShape.highlightStyle = {
+                xEnd: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align),
+                strokeColor: lineStyle.color || defaultColor,
+                lineType: lineStyle.type,
+                lineWidth: lineStyle.width
+            };
+            return new LineShape(lineShape);
+        },
+        _getLabelPoint: function (position, x, location, topWidth, bottomWidth, lineLength, align) {
+            position = position === 'inner' || position === 'inside' ? 'center' : position;
+            switch (position) {
+            case 'center':
+                return align == 'center' ? x + topWidth / 2 : align == 'left' ? x + 10 : x + topWidth - 10;
+            case 'left':
+                if (lineLength === 'auto') {
+                    return location.x - 10;
+                } else {
+                    return align == 'center' ? location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength : align == 'right' ? x - (topWidth < bottomWidth ? bottomWidth - topWidth : 0) - lineLength : location.x - lineLength;
+                }
+                break;
+            default:
+                if (lineLength === 'auto') {
+                    return location.x + location.width + 10;
+                } else {
+                    return align == 'center' ? location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength : align == 'right' ? location.x + location.width + lineLength : x + Math.max(topWidth, bottomWidth) + lineLength;
+                }
+            }
+        },
+        _getLabelLineStartPoint: function (x, location, topWidth, bottomWidth, align) {
+            return align == 'center' ? location.centerX : topWidth < bottomWidth ? x + Math.min(topWidth, bottomWidth) / 2 : x + Math.max(topWidth, bottomWidth) / 2;
+        },
+        _needLabel: function (serie, data, isEmphasis) {
+            return this.deepQuery([
+                data,
+                serie
+            ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.label.show');
+        },
+        _needLabelLine: function (serie, data, isEmphasis) {
+            return this.deepQuery([
+                data,
+                serie
+            ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.labelLine.show');
+        },
+        refresh: function (newOption) {
+            if (newOption) {
+                this.option = newOption;
+                this.series = newOption.series;
+            }
+            this.backupShapeList();
+            this._buildShape();
+        }
+    };
+    zrUtil.inherits(Funnel, ChartBase);
+    require('../chart').define('funnel', Funnel);
+    return Funnel;
+});

+ 577 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/gauge.js

@@ -0,0 +1,577 @@
+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 (require) {
+    var ChartBase = require('./base');
+    var GaugePointerShape = require('../util/shape/GaugePointer');
+    var TextShape = require('zrender/shape/Text');
+    var LineShape = require('zrender/shape/Line');
+    var RectangleShape = require('zrender/shape/Rectangle');
+    var CircleShape = require('zrender/shape/Circle');
+    var SectorShape = require('zrender/shape/Sector');
+    var ecConfig = require('../config');
+    ecConfig.gauge = {
+        zlevel: 0,
+        z: 2,
+        center: [
+            '50%',
+            '50%'
+        ],
+        clickable: true,
+        legendHoverLink: true,
+        radius: '75%',
+        startAngle: 225,
+        endAngle: -45,
+        min: 0,
+        max: 100,
+        splitNumber: 10,
+        axisLine: {
+            show: true,
+            lineStyle: {
+                color: [
+                    [
+                        0.2,
+                        '#228b22'
+                    ],
+                    [
+                        0.8,
+                        '#48b'
+                    ],
+                    [
+                        1,
+                        '#ff4500'
+                    ]
+                ],
+                width: 30
+            }
+        },
+        axisTick: {
+            show: true,
+            splitNumber: 5,
+            length: 8,
+            lineStyle: {
+                color: '#eee',
+                width: 1,
+                type: 'solid'
+            }
+        },
+        axisLabel: {
+            show: true,
+            textStyle: { color: 'auto' }
+        },
+        splitLine: {
+            show: true,
+            length: 30,
+            lineStyle: {
+                color: '#eee',
+                width: 2,
+                type: 'solid'
+            }
+        },
+        pointer: {
+            show: true,
+            length: '80%',
+            width: 8,
+            color: 'auto'
+        },
+        title: {
+            show: true,
+            offsetCenter: [
+                0,
+                '-40%'
+            ],
+            textStyle: {
+                color: '#333',
+                fontSize: 15
+            }
+        },
+        detail: {
+            show: true,
+            backgroundColor: 'rgba(0,0,0,0)',
+            borderWidth: 0,
+            borderColor: '#ccc',
+            width: 100,
+            height: 40,
+            offsetCenter: [
+                0,
+                '40%'
+            ],
+            textStyle: {
+                color: 'auto',
+                fontSize: 30
+            }
+        }
+    };
+    var ecData = require('../util/ecData');
+    var accMath = require('../util/accMath');
+    var zrUtil = require('zrender/tool/util');
+    function Gauge(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        this.refresh(option);
+    }
+    Gauge.prototype = {
+        type: ecConfig.CHART_TYPE_GAUGE,
+        _buildShape: function () {
+            var series = this.series;
+            this._paramsMap = {};
+            this.selectedMap = {};
+            for (var i = 0, l = series.length; i < l; i++) {
+                if (series[i].type === ecConfig.CHART_TYPE_GAUGE) {
+                    this.selectedMap[series[i].name] = true;
+                    series[i] = this.reformOption(series[i]);
+                    this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink;
+                    this._buildSingleGauge(i);
+                    this.buildMark(i);
+                }
+            }
+            this.addShapeList();
+        },
+        _buildSingleGauge: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            this._paramsMap[seriesIndex] = {
+                center: this.parseCenter(this.zr, serie.center),
+                radius: this.parseRadius(this.zr, serie.radius),
+                startAngle: serie.startAngle.toFixed(2) - 0,
+                endAngle: serie.endAngle.toFixed(2) - 0
+            };
+            this._paramsMap[seriesIndex].totalAngle = this._paramsMap[seriesIndex].startAngle - this._paramsMap[seriesIndex].endAngle;
+            this._colorMap(seriesIndex);
+            this._buildAxisLine(seriesIndex);
+            this._buildSplitLine(seriesIndex);
+            this._buildAxisTick(seriesIndex);
+            this._buildAxisLabel(seriesIndex);
+            this._buildPointer(seriesIndex);
+            this._buildTitle(seriesIndex);
+            this._buildDetail(seriesIndex);
+        },
+        _buildAxisLine: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            if (!serie.axisLine.show) {
+                return;
+            }
+            var min = serie.min;
+            var total = serie.max - min;
+            var params = this._paramsMap[seriesIndex];
+            var center = params.center;
+            var startAngle = params.startAngle;
+            var totalAngle = params.totalAngle;
+            var colorArray = params.colorArray;
+            var lineStyle = serie.axisLine.lineStyle;
+            var lineWidth = this.parsePercent(lineStyle.width, params.radius[1]);
+            var r = params.radius[1];
+            var r0 = r - lineWidth;
+            var sectorShape;
+            var lastAngle = startAngle;
+            var newAngle;
+            for (var i = 0, l = colorArray.length; i < l; i++) {
+                newAngle = startAngle - totalAngle * (colorArray[i][0] - min) / total;
+                sectorShape = this._getSector(center, r0, r, newAngle, lastAngle, colorArray[i][1], lineStyle, serie.zlevel, serie.z);
+                lastAngle = newAngle;
+                sectorShape._animationAdd = 'r';
+                ecData.set(sectorShape, 'seriesIndex', seriesIndex);
+                ecData.set(sectorShape, 'dataIndex', i);
+                this.shapeList.push(sectorShape);
+            }
+        },
+        _buildSplitLine: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            if (!serie.splitLine.show) {
+                return;
+            }
+            var params = this._paramsMap[seriesIndex];
+            var splitNumber = serie.splitNumber;
+            var min = serie.min;
+            var total = serie.max - min;
+            var splitLine = serie.splitLine;
+            var length = this.parsePercent(splitLine.length, params.radius[1]);
+            var lineStyle = splitLine.lineStyle;
+            var color = lineStyle.color;
+            var center = params.center;
+            var startAngle = params.startAngle * Math.PI / 180;
+            var totalAngle = params.totalAngle * Math.PI / 180;
+            var r = params.radius[1];
+            var r0 = r - length;
+            var angle;
+            var sinAngle;
+            var cosAngle;
+            for (var i = 0; i <= splitNumber; i++) {
+                angle = startAngle - totalAngle / splitNumber * i;
+                sinAngle = Math.sin(angle);
+                cosAngle = Math.cos(angle);
+                this.shapeList.push(new LineShape({
+                    zlevel: serie.zlevel,
+                    z: serie.z + 1,
+                    hoverable: false,
+                    style: {
+                        xStart: center[0] + cosAngle * r,
+                        yStart: center[1] - sinAngle * r,
+                        xEnd: center[0] + cosAngle * r0,
+                        yEnd: center[1] - sinAngle * r0,
+                        strokeColor: color === 'auto' ? this._getColor(seriesIndex, min + total / splitNumber * i) : color,
+                        lineType: lineStyle.type,
+                        lineWidth: lineStyle.width,
+                        shadowColor: lineStyle.shadowColor,
+                        shadowBlur: lineStyle.shadowBlur,
+                        shadowOffsetX: lineStyle.shadowOffsetX,
+                        shadowOffsetY: lineStyle.shadowOffsetY
+                    }
+                }));
+            }
+        },
+        _buildAxisTick: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            if (!serie.axisTick.show) {
+                return;
+            }
+            var params = this._paramsMap[seriesIndex];
+            var splitNumber = serie.splitNumber;
+            var min = serie.min;
+            var total = serie.max - min;
+            var axisTick = serie.axisTick;
+            var tickSplit = axisTick.splitNumber;
+            var length = this.parsePercent(axisTick.length, params.radius[1]);
+            var lineStyle = axisTick.lineStyle;
+            var color = lineStyle.color;
+            var center = params.center;
+            var startAngle = params.startAngle * Math.PI / 180;
+            var totalAngle = params.totalAngle * Math.PI / 180;
+            var r = params.radius[1];
+            var r0 = r - length;
+            var angle;
+            var sinAngle;
+            var cosAngle;
+            for (var i = 0, l = splitNumber * tickSplit; i <= l; i++) {
+                if (i % tickSplit === 0) {
+                    continue;
+                }
+                angle = startAngle - totalAngle / l * i;
+                sinAngle = Math.sin(angle);
+                cosAngle = Math.cos(angle);
+                this.shapeList.push(new LineShape({
+                    zlevel: serie.zlevel,
+                    z: serie.z + 1,
+                    hoverable: false,
+                    style: {
+                        xStart: center[0] + cosAngle * r,
+                        yStart: center[1] - sinAngle * r,
+                        xEnd: center[0] + cosAngle * r0,
+                        yEnd: center[1] - sinAngle * r0,
+                        strokeColor: color === 'auto' ? this._getColor(seriesIndex, min + total / l * i) : color,
+                        lineType: lineStyle.type,
+                        lineWidth: lineStyle.width,
+                        shadowColor: lineStyle.shadowColor,
+                        shadowBlur: lineStyle.shadowBlur,
+                        shadowOffsetX: lineStyle.shadowOffsetX,
+                        shadowOffsetY: lineStyle.shadowOffsetY
+                    }
+                }));
+            }
+        },
+        _buildAxisLabel: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            if (!serie.axisLabel.show) {
+                return;
+            }
+            var splitNumber = serie.splitNumber;
+            var min = serie.min;
+            var total = serie.max - min;
+            var textStyle = serie.axisLabel.textStyle;
+            var textFont = this.getFont(textStyle);
+            var color = textStyle.color;
+            var params = this._paramsMap[seriesIndex];
+            var center = params.center;
+            var startAngle = params.startAngle;
+            var totalAngle = params.totalAngle;
+            var r0 = params.radius[1] - this.parsePercent(serie.splitLine.length, params.radius[1]) - 5;
+            var angle;
+            var sinAngle;
+            var cosAngle;
+            var value;
+            for (var i = 0; i <= splitNumber; i++) {
+                value = accMath.accAdd(min, accMath.accMul(accMath.accDiv(total, splitNumber), i));
+                angle = startAngle - totalAngle / splitNumber * i;
+                sinAngle = Math.sin(angle * Math.PI / 180);
+                cosAngle = Math.cos(angle * Math.PI / 180);
+                angle = (angle + 360) % 360;
+                this.shapeList.push(new TextShape({
+                    zlevel: serie.zlevel,
+                    z: serie.z + 1,
+                    hoverable: false,
+                    style: {
+                        x: center[0] + cosAngle * r0,
+                        y: center[1] - sinAngle * r0,
+                        color: color === 'auto' ? this._getColor(seriesIndex, value) : color,
+                        text: this._getLabelText(serie.axisLabel.formatter, value),
+                        textAlign: angle >= 110 && angle <= 250 ? 'left' : angle <= 70 || angle >= 290 ? 'right' : 'center',
+                        textBaseline: angle >= 10 && angle <= 170 ? 'top' : angle >= 190 && angle <= 350 ? 'bottom' : 'middle',
+                        textFont: textFont,
+                        shadowColor: textStyle.shadowColor,
+                        shadowBlur: textStyle.shadowBlur,
+                        shadowOffsetX: textStyle.shadowOffsetX,
+                        shadowOffsetY: textStyle.shadowOffsetY
+                    }
+                }));
+            }
+        },
+        _buildPointer: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            if (!serie.pointer.show) {
+                return;
+            }
+            var total = serie.max - serie.min;
+            var pointer = serie.pointer;
+            var params = this._paramsMap[seriesIndex];
+            var length = this.parsePercent(pointer.length, params.radius[1]);
+            var width = this.parsePercent(pointer.width, params.radius[1]);
+            var center = params.center;
+            var value = this._getValue(seriesIndex);
+            value = value < serie.max ? value : serie.max;
+            var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180;
+            var color = pointer.color === 'auto' ? this._getColor(seriesIndex, value) : pointer.color;
+            var pointShape = new GaugePointerShape({
+                zlevel: serie.zlevel,
+                z: serie.z + 1,
+                clickable: this.query(serie, 'clickable'),
+                style: {
+                    x: center[0],
+                    y: center[1],
+                    r: length,
+                    startAngle: params.startAngle * Math.PI / 180,
+                    angle: angle,
+                    color: color,
+                    width: width,
+                    shadowColor: pointer.shadowColor,
+                    shadowBlur: pointer.shadowBlur,
+                    shadowOffsetX: pointer.shadowOffsetX,
+                    shadowOffsetY: pointer.shadowOffsetY
+                },
+                highlightStyle: {
+                    brushType: 'fill',
+                    width: width > 2 ? 2 : width / 2,
+                    color: '#fff'
+                }
+            });
+            ecData.pack(pointShape, this.series[seriesIndex], seriesIndex, this.series[seriesIndex].data[0], 0, this.series[seriesIndex].data[0].name, value);
+            this.shapeList.push(pointShape);
+            this.shapeList.push(new CircleShape({
+                zlevel: serie.zlevel,
+                z: serie.z + 2,
+                hoverable: false,
+                style: {
+                    x: center[0],
+                    y: center[1],
+                    r: pointer.width / 2.5,
+                    color: '#fff'
+                }
+            }));
+        },
+        _buildTitle: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            if (!serie.title.show) {
+                return;
+            }
+            var data = serie.data[0];
+            var name = data.name != null ? data.name : '';
+            if (name !== '') {
+                var title = serie.title;
+                var offsetCenter = title.offsetCenter;
+                var textStyle = title.textStyle;
+                var textColor = textStyle.color;
+                var params = this._paramsMap[seriesIndex];
+                var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]);
+                var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]);
+                this.shapeList.push(new TextShape({
+                    zlevel: serie.zlevel,
+                    z: serie.z + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1]) < textStyle.fontSize * 2 ? 2 : 1),
+                    hoverable: false,
+                    style: {
+                        x: x,
+                        y: y,
+                        color: textColor === 'auto' ? this._getColor(seriesIndex) : textColor,
+                        text: name,
+                        textAlign: 'center',
+                        textFont: this.getFont(textStyle),
+                        shadowColor: textStyle.shadowColor,
+                        shadowBlur: textStyle.shadowBlur,
+                        shadowOffsetX: textStyle.shadowOffsetX,
+                        shadowOffsetY: textStyle.shadowOffsetY
+                    }
+                }));
+            }
+        },
+        _buildDetail: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            if (!serie.detail.show) {
+                return;
+            }
+            var detail = serie.detail;
+            var offsetCenter = detail.offsetCenter;
+            var color = detail.backgroundColor;
+            var textStyle = detail.textStyle;
+            var textColor = textStyle.color;
+            var params = this._paramsMap[seriesIndex];
+            var value = this._getValue(seriesIndex);
+            var x = params.center[0] - detail.width / 2 + this.parsePercent(offsetCenter[0], params.radius[1]);
+            var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]);
+            this.shapeList.push(new RectangleShape({
+                zlevel: serie.zlevel,
+                z: serie.z + (Math.abs(x + detail.width / 2 - params.center[0]) + Math.abs(y + detail.height / 2 - params.center[1]) < textStyle.fontSize ? 2 : 1),
+                hoverable: false,
+                style: {
+                    x: x,
+                    y: y,
+                    width: detail.width,
+                    height: detail.height,
+                    brushType: 'both',
+                    color: color === 'auto' ? this._getColor(seriesIndex, value) : color,
+                    lineWidth: detail.borderWidth,
+                    strokeColor: detail.borderColor,
+                    shadowColor: detail.shadowColor,
+                    shadowBlur: detail.shadowBlur,
+                    shadowOffsetX: detail.shadowOffsetX,
+                    shadowOffsetY: detail.shadowOffsetY,
+                    text: this._getLabelText(detail.formatter, value),
+                    textFont: this.getFont(textStyle),
+                    textPosition: 'inside',
+                    textColor: textColor === 'auto' ? this._getColor(seriesIndex, value) : textColor
+                }
+            }));
+        },
+        _getValue: function (seriesIndex) {
+            return this.getDataFromOption(this.series[seriesIndex].data[0]);
+        },
+        _colorMap: function (seriesIndex) {
+            var serie = this.series[seriesIndex];
+            var min = serie.min;
+            var total = serie.max - min;
+            var color = serie.axisLine.lineStyle.color;
+            if (!(color instanceof Array)) {
+                color = [[
+                        1,
+                        color
+                    ]];
+            }
+            var colorArray = [];
+            for (var i = 0, l = color.length; i < l; i++) {
+                colorArray.push([
+                    color[i][0] * total + min,
+                    color[i][1]
+                ]);
+            }
+            this._paramsMap[seriesIndex].colorArray = colorArray;
+        },
+        _getColor: function (seriesIndex, value) {
+            if (value == null) {
+                value = this._getValue(seriesIndex);
+            }
+            var colorArray = this._paramsMap[seriesIndex].colorArray;
+            for (var i = 0, l = colorArray.length; i < l; i++) {
+                if (colorArray[i][0] >= value) {
+                    return colorArray[i][1];
+                }
+            }
+            return colorArray[colorArray.length - 1][1];
+        },
+        _getSector: function (center, r0, r, startAngle, endAngle, color, lineStyle, zlevel, z) {
+            return new SectorShape({
+                zlevel: zlevel,
+                z: z,
+                hoverable: false,
+                style: {
+                    x: center[0],
+                    y: center[1],
+                    r0: r0,
+                    r: r,
+                    startAngle: startAngle,
+                    endAngle: endAngle,
+                    brushType: 'fill',
+                    color: color,
+                    shadowColor: lineStyle.shadowColor,
+                    shadowBlur: lineStyle.shadowBlur,
+                    shadowOffsetX: lineStyle.shadowOffsetX,
+                    shadowOffsetY: lineStyle.shadowOffsetY
+                }
+            });
+        },
+        _getLabelText: function (formatter, value) {
+            if (formatter) {
+                if (typeof formatter === 'function') {
+                    return formatter.call(this.myChart, value);
+                } else if (typeof formatter === 'string') {
+                    return formatter.replace('{value}', value);
+                }
+            }
+            return value;
+        },
+        refresh: function (newOption) {
+            if (newOption) {
+                this.option = newOption;
+                this.series = newOption.series;
+            }
+            this.backupShapeList();
+            this._buildShape();
+        }
+    };
+    zrUtil.inherits(Gauge, ChartBase);
+    require('../chart').define('gauge', Gauge);
+    return Gauge;
+});define('echarts/util/shape/GaugePointer', [
+    'require',
+    'zrender/shape/Base',
+    'zrender/tool/util',
+    './normalIsCover'
+], function (require) {
+    var Base = require('zrender/shape/Base');
+    var zrUtil = require('zrender/tool/util');
+    function GaugePointer(options) {
+        Base.call(this, options);
+    }
+    GaugePointer.prototype = {
+        type: 'gauge-pointer',
+        buildPath: function (ctx, style) {
+            var r = style.r;
+            var width = style.width;
+            var angle = style.angle;
+            var x = style.x - Math.cos(angle) * width * (width >= r / 3 ? 1 : 2);
+            var y = style.y + Math.sin(angle) * width * (width >= r / 3 ? 1 : 2);
+            angle = style.angle - Math.PI / 2;
+            ctx.moveTo(x, y);
+            ctx.lineTo(style.x + Math.cos(angle) * width, style.y - Math.sin(angle) * width);
+            ctx.lineTo(style.x + Math.cos(style.angle) * r, style.y - Math.sin(style.angle) * r);
+            ctx.lineTo(style.x - Math.cos(angle) * width, style.y + Math.sin(angle) * width);
+            ctx.lineTo(x, y);
+            return;
+        },
+        getRect: function (style) {
+            if (style.__rect) {
+                return style.__rect;
+            }
+            var width = style.width * 2;
+            var xStart = style.x;
+            var yStart = style.y;
+            var xEnd = xStart + Math.cos(style.angle) * style.r;
+            var yEnd = yStart - Math.sin(style.angle) * style.r;
+            style.__rect = {
+                x: Math.min(xStart, xEnd) - width,
+                y: Math.min(yStart, yEnd) - width,
+                width: Math.abs(xStart - xEnd) + width,
+                height: Math.abs(yStart - yEnd) + width
+            };
+            return style.__rect;
+        },
+        isCover: require('./normalIsCover')
+    };
+    zrUtil.inherits(GaugePointer, Base);
+    return GaugePointer;
+});

+ 286 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/heatmap.js

@@ -0,0 +1,286 @@
+define('echarts/chart/heatmap', [
+    'require',
+    './base',
+    '../layer/heatmap',
+    '../config',
+    '../util/ecData',
+    'zrender/tool/util',
+    'zrender/tool/color',
+    'zrender/shape/Image',
+    '../chart'
+], function (require) {
+    var ChartBase = require('./base');
+    var HeatmapLayer = require('../layer/heatmap');
+    var ecConfig = require('../config');
+    var ecData = require('../util/ecData');
+    var zrUtil = require('zrender/tool/util');
+    var zrColor = require('zrender/tool/color');
+    var zrImage = require('zrender/shape/Image');
+    ecConfig.heatmap = {
+        zlevel: 0,
+        z: 2,
+        clickable: true
+    };
+    function Heatmap(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        this.refresh(option);
+    }
+    Heatmap.prototype = {
+        type: ecConfig.CHART_TYPE_HEATMAP,
+        refresh: function (newOption) {
+            this.clear();
+            if (newOption) {
+                this.option = newOption;
+                this.series = newOption.series;
+            }
+            this._init();
+        },
+        _init: function () {
+            var series = this.series;
+            this.backupShapeList();
+            var len = series.length;
+            for (var i = 0; i < len; ++i) {
+                if (series[i].type === ecConfig.CHART_TYPE_HEATMAP) {
+                    series[i] = this.reformOption(series[i]);
+                    var layer = new HeatmapLayer(series[i]);
+                    var canvas = layer.getCanvas(series[i].data, this.zr.getWidth(), this.zr.getHeight());
+                    var image = new zrImage({
+                        position: [
+                            0,
+                            0
+                        ],
+                        scale: [
+                            1,
+                            1
+                        ],
+                        hoverable: this.option.hoverable,
+                        style: {
+                            x: 0,
+                            y: 0,
+                            image: canvas,
+                            width: canvas.width,
+                            height: canvas.height
+                        }
+                    });
+                    this.shapeList.push(image);
+                }
+            }
+            this.addShapeList();
+        }
+    };
+    zrUtil.inherits(Heatmap, ChartBase);
+    require('../chart').define('heatmap', Heatmap);
+    return Heatmap;
+});define('echarts/layer/heatmap', ['require'], function (require) {
+    var defaultOptions = {
+        blurSize: 30,
+        gradientColors: [
+            'blue',
+            'cyan',
+            'lime',
+            'yellow',
+            'red'
+        ],
+        minAlpha: 0.05,
+        valueScale: 1,
+        opacity: 1
+    };
+    var BRUSH_SIZE = 20;
+    var GRADIENT_LEVELS = 256;
+    function Heatmap(opt) {
+        this.option = opt;
+        if (opt) {
+            for (var i in defaultOptions) {
+                if (opt[i] !== undefined) {
+                    this.option[i] = opt[i];
+                } else {
+                    this.option[i] = defaultOptions[i];
+                }
+            }
+        } else {
+            this.option = defaultOptions;
+        }
+    }
+    Heatmap.prototype = {
+        getCanvas: function (data, width, height) {
+            var brush = this._getBrush();
+            var gradient = this._getGradient();
+            var r = BRUSH_SIZE + this.option.blurSize;
+            var canvas = document.createElement('canvas');
+            canvas.width = width;
+            canvas.height = height;
+            var ctx = canvas.getContext('2d');
+            var len = data.length;
+            for (var i = 0; i < len; ++i) {
+                var p = data[i];
+                var x = p[0];
+                var y = p[1];
+                var value = p[2];
+                var alpha = Math.min(1, Math.max(value * this.option.valueScale || this.option.minAlpha, this.option.minAlpha));
+                ctx.globalAlpha = alpha;
+                ctx.drawImage(brush, x - r, y - r);
+            }
+            var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
+            var pixels = imageData.data;
+            var len = pixels.length / 4;
+            while (len--) {
+                var id = len * 4 + 3;
+                var alpha = pixels[id] / 256;
+                var colorOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1));
+                pixels[id - 3] = gradient[colorOffset * 4];
+                pixels[id - 2] = gradient[colorOffset * 4 + 1];
+                pixels[id - 1] = gradient[colorOffset * 4 + 2];
+                pixels[id] *= this.option.opacity;
+            }
+            ctx.putImageData(imageData, 0, 0);
+            return canvas;
+        },
+        _getBrush: function () {
+            if (!this._brushCanvas) {
+                this._brushCanvas = document.createElement('canvas');
+                var r = BRUSH_SIZE + this.option.blurSize;
+                var d = r * 2;
+                this._brushCanvas.width = d;
+                this._brushCanvas.height = d;
+                var ctx = this._brushCanvas.getContext('2d');
+                ctx.shadowOffsetX = d;
+                ctx.shadowBlur = this.option.blurSize;
+                ctx.shadowColor = 'black';
+                ctx.beginPath();
+                ctx.arc(-r, r, BRUSH_SIZE, 0, Math.PI * 2, true);
+                ctx.closePath();
+                ctx.fill();
+            }
+            return this._brushCanvas;
+        },
+        _getGradient: function () {
+            if (!this._gradientPixels) {
+                var levels = GRADIENT_LEVELS;
+                var canvas = document.createElement('canvas');
+                canvas.width = 1;
+                canvas.height = levels;
+                var ctx = canvas.getContext('2d');
+                var gradient = ctx.createLinearGradient(0, 0, 0, levels);
+                var len = this.option.gradientColors.length;
+                for (var i = 0; i < len; ++i) {
+                    if (typeof this.option.gradientColors[i] === 'string') {
+                        gradient.addColorStop((i + 1) / len, this.option.gradientColors[i]);
+                    } else {
+                        gradient.addColorStop(this.option.gradientColors[i].offset, this.option.gradientColors[i].color);
+                    }
+                }
+                ctx.fillStyle = gradient;
+                ctx.fillRect(0, 0, 1, levels);
+                this._gradientPixels = ctx.getImageData(0, 0, 1, levels).data;
+            }
+            return this._gradientPixels;
+        }
+    };
+    return Heatmap;
+});define('echarts/layer/heatmap', ['require'], function (require) {
+    var defaultOptions = {
+        blurSize: 30,
+        gradientColors: [
+            'blue',
+            'cyan',
+            'lime',
+            'yellow',
+            'red'
+        ],
+        minAlpha: 0.05,
+        valueScale: 1,
+        opacity: 1
+    };
+    var BRUSH_SIZE = 20;
+    var GRADIENT_LEVELS = 256;
+    function Heatmap(opt) {
+        this.option = opt;
+        if (opt) {
+            for (var i in defaultOptions) {
+                if (opt[i] !== undefined) {
+                    this.option[i] = opt[i];
+                } else {
+                    this.option[i] = defaultOptions[i];
+                }
+            }
+        } else {
+            this.option = defaultOptions;
+        }
+    }
+    Heatmap.prototype = {
+        getCanvas: function (data, width, height) {
+            var brush = this._getBrush();
+            var gradient = this._getGradient();
+            var r = BRUSH_SIZE + this.option.blurSize;
+            var canvas = document.createElement('canvas');
+            canvas.width = width;
+            canvas.height = height;
+            var ctx = canvas.getContext('2d');
+            var len = data.length;
+            for (var i = 0; i < len; ++i) {
+                var p = data[i];
+                var x = p[0];
+                var y = p[1];
+                var value = p[2];
+                var alpha = Math.min(1, Math.max(value * this.option.valueScale || this.option.minAlpha, this.option.minAlpha));
+                ctx.globalAlpha = alpha;
+                ctx.drawImage(brush, x - r, y - r);
+            }
+            var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
+            var pixels = imageData.data;
+            var len = pixels.length / 4;
+            while (len--) {
+                var id = len * 4 + 3;
+                var alpha = pixels[id] / 256;
+                var colorOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1));
+                pixels[id - 3] = gradient[colorOffset * 4];
+                pixels[id - 2] = gradient[colorOffset * 4 + 1];
+                pixels[id - 1] = gradient[colorOffset * 4 + 2];
+                pixels[id] *= this.option.opacity;
+            }
+            ctx.putImageData(imageData, 0, 0);
+            return canvas;
+        },
+        _getBrush: function () {
+            if (!this._brushCanvas) {
+                this._brushCanvas = document.createElement('canvas');
+                var r = BRUSH_SIZE + this.option.blurSize;
+                var d = r * 2;
+                this._brushCanvas.width = d;
+                this._brushCanvas.height = d;
+                var ctx = this._brushCanvas.getContext('2d');
+                ctx.shadowOffsetX = d;
+                ctx.shadowBlur = this.option.blurSize;
+                ctx.shadowColor = 'black';
+                ctx.beginPath();
+                ctx.arc(-r, r, BRUSH_SIZE, 0, Math.PI * 2, true);
+                ctx.closePath();
+                ctx.fill();
+            }
+            return this._brushCanvas;
+        },
+        _getGradient: function () {
+            if (!this._gradientPixels) {
+                var levels = GRADIENT_LEVELS;
+                var canvas = document.createElement('canvas');
+                canvas.width = 1;
+                canvas.height = levels;
+                var ctx = canvas.getContext('2d');
+                var gradient = ctx.createLinearGradient(0, 0, 0, levels);
+                var len = this.option.gradientColors.length;
+                for (var i = 0; i < len; ++i) {
+                    if (typeof this.option.gradientColors[i] === 'string') {
+                        gradient.addColorStop((i + 1) / len, this.option.gradientColors[i]);
+                    } else {
+                        gradient.addColorStop(this.option.gradientColors[i].offset, this.option.gradientColors[i].color);
+                    }
+                }
+                ctx.fillStyle = gradient;
+                ctx.fillRect(0, 0, 1, levels);
+                this._gradientPixels = ctx.getImageData(0, 0, 1, levels).data;
+            }
+            return this._gradientPixels;
+        }
+    };
+    return Heatmap;
+});

File diff suppressed because it is too large
+ 325 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/k.js


+ 817 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/line.js

@@ -0,0 +1,817 @@
+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 (require) {
+    var ChartBase = require('./base');
+    var PolylineShape = require('zrender/shape/Polyline');
+    var IconShape = require('../util/shape/Icon');
+    var HalfSmoothPolygonShape = require('../util/shape/HalfSmoothPolygon');
+    require('../component/axis');
+    require('../component/grid');
+    require('../component/dataZoom');
+    var ecConfig = require('../config');
+    ecConfig.line = {
+        zlevel: 0,
+        z: 2,
+        clickable: true,
+        legendHoverLink: true,
+        xAxisIndex: 0,
+        yAxisIndex: 0,
+        dataFilter: 'nearest',
+        itemStyle: {
+            normal: {
+                label: { show: false },
+                lineStyle: {
+                    width: 2,
+                    type: 'solid',
+                    shadowColor: 'rgba(0,0,0,0)',
+                    shadowBlur: 0,
+                    shadowOffsetX: 0,
+                    shadowOffsetY: 0
+                }
+            },
+            emphasis: { label: { show: false } }
+        },
+        symbolSize: 2,
+        showAllSymbol: false
+    };
+    var ecData = require('../util/ecData');
+    var zrUtil = require('zrender/tool/util');
+    var zrColor = require('zrender/tool/color');
+    function Line(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        this.refresh(option);
+    }
+    Line.prototype = {
+        type: ecConfig.CHART_TYPE_LINE,
+        _buildShape: function () {
+            this.finalPLMap = {};
+            this._buildPosition();
+        },
+        _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) {
+            var series = this.series;
+            var seriesIndex = locationMap[0][0];
+            var serie = series[seriesIndex];
+            var categoryAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0);
+            var valueAxis;
+            var x;
+            var y;
+            var lastYP;
+            var baseYP;
+            var lastYN;
+            var baseYN;
+            var curPLMap = {};
+            var data;
+            var value;
+            for (var i = 0, l = maxDataLength; i < l; i++) {
+                if (categoryAxis.getNameByIndex(i) == null) {
+                    break;
+                }
+                x = categoryAxis.getCoordByIndex(i);
+                for (var j = 0, k = locationMap.length; j < k; j++) {
+                    valueAxis = this.component.yAxis.getAxis(series[locationMap[j][0]].yAxisIndex || 0);
+                    baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0);
+                    for (var m = 0, n = locationMap[j].length; m < n; m++) {
+                        seriesIndex = locationMap[j][m];
+                        serie = series[seriesIndex];
+                        data = serie.data[i];
+                        value = this.getDataFromOption(data, '-');
+                        curPLMap[seriesIndex] = curPLMap[seriesIndex] || [];
+                        xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {
+                            min: Number.POSITIVE_INFINITY,
+                            max: Number.NEGATIVE_INFINITY,
+                            sum: 0,
+                            counter: 0,
+                            average: 0
+                        };
+                        if (value === '-') {
+                            if (curPLMap[seriesIndex].length > 0) {
+                                this.finalPLMap[seriesIndex] = this.finalPLMap[seriesIndex] || [];
+                                this.finalPLMap[seriesIndex].push(curPLMap[seriesIndex]);
+                                curPLMap[seriesIndex] = [];
+                            }
+                            continue;
+                        }
+                        if (value >= 0) {
+                            lastYP -= m > 0 ? valueAxis.getCoordSize(value) : baseYP - valueAxis.getCoord(value);
+                            y = lastYP;
+                        } else if (value < 0) {
+                            lastYN += m > 0 ? valueAxis.getCoordSize(value) : valueAxis.getCoord(value) - baseYN;
+                            y = lastYN;
+                        }
+                        curPLMap[seriesIndex].push([
+                            x,
+                            y,
+                            i,
+                            categoryAxis.getNameByIndex(i),
+                            x,
+                            baseYP
+                        ]);
+                        if (xMarkMap[seriesIndex].min > value) {
+                            xMarkMap[seriesIndex].min = value;
+                            xMarkMap[seriesIndex].minY = y;
+                            xMarkMap[seriesIndex].minX = x;
+                        }
+                        if (xMarkMap[seriesIndex].max < value) {
+                            xMarkMap[seriesIndex].max = value;
+                            xMarkMap[seriesIndex].maxY = y;
+                            xMarkMap[seriesIndex].maxX = x;
+                        }
+                        xMarkMap[seriesIndex].sum += value;
+                        xMarkMap[seriesIndex].counter++;
+                    }
+                }
+                lastYP = this.component.grid.getY();
+                var symbolSize;
+                for (var j = 0, k = locationMap.length; j < k; j++) {
+                    for (var m = 0, n = locationMap[j].length; m < n; m++) {
+                        seriesIndex = locationMap[j][m];
+                        serie = series[seriesIndex];
+                        data = serie.data[i];
+                        value = this.getDataFromOption(data, '-');
+                        if (value != '-') {
+                            continue;
+                        }
+                        if (this.deepQuery([
+                                data,
+                                serie,
+                                this.option
+                            ], 'calculable')) {
+                            symbolSize = this.deepQuery([
+                                data,
+                                serie
+                            ], 'symbolSize');
+                            lastYP += symbolSize * 2 + 5;
+                            y = lastYP;
+                            this.shapeList.push(this._getCalculableItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y, 'horizontal'));
+                        }
+                    }
+                }
+            }
+            for (var sId in curPLMap) {
+                if (curPLMap[sId].length > 0) {
+                    this.finalPLMap[sId] = this.finalPLMap[sId] || [];
+                    this.finalPLMap[sId].push(curPLMap[sId]);
+                    curPLMap[sId] = [];
+                }
+            }
+            this._calculMarkMapXY(xMarkMap, locationMap, 'y');
+            this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'horizontal');
+        },
+        _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) {
+            var series = this.series;
+            var seriesIndex = locationMap[0][0];
+            var serie = series[seriesIndex];
+            var categoryAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0);
+            var valueAxis;
+            var x;
+            var y;
+            var lastXP;
+            var baseXP;
+            var lastXN;
+            var baseXN;
+            var curPLMap = {};
+            var data;
+            var value;
+            for (var i = 0, l = maxDataLength; i < l; i++) {
+                if (categoryAxis.getNameByIndex(i) == null) {
+                    break;
+                }
+                y = categoryAxis.getCoordByIndex(i);
+                for (var j = 0, k = locationMap.length; j < k; j++) {
+                    valueAxis = this.component.xAxis.getAxis(series[locationMap[j][0]].xAxisIndex || 0);
+                    baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0);
+                    for (var m = 0, n = locationMap[j].length; m < n; m++) {
+                        seriesIndex = locationMap[j][m];
+                        serie = series[seriesIndex];
+                        data = serie.data[i];
+                        value = this.getDataFromOption(data, '-');
+                        curPLMap[seriesIndex] = curPLMap[seriesIndex] || [];
+                        xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {
+                            min: Number.POSITIVE_INFINITY,
+                            max: Number.NEGATIVE_INFINITY,
+                            sum: 0,
+                            counter: 0,
+                            average: 0
+                        };
+                        if (value === '-') {
+                            if (curPLMap[seriesIndex].length > 0) {
+                                this.finalPLMap[seriesIndex] = this.finalPLMap[seriesIndex] || [];
+                                this.finalPLMap[seriesIndex].push(curPLMap[seriesIndex]);
+                                curPLMap[seriesIndex] = [];
+                            }
+                            continue;
+                        }
+                        if (value >= 0) {
+                            lastXP += m > 0 ? valueAxis.getCoordSize(value) : valueAxis.getCoord(value) - baseXP;
+                            x = lastXP;
+                        } else if (value < 0) {
+                            lastXN -= m > 0 ? valueAxis.getCoordSize(value) : baseXN - valueAxis.getCoord(value);
+                            x = lastXN;
+                        }
+                        curPLMap[seriesIndex].push([
+                            x,
+                            y,
+                            i,
+                            categoryAxis.getNameByIndex(i),
+                            baseXP,
+                            y
+                        ]);
+                        if (xMarkMap[seriesIndex].min > value) {
+                            xMarkMap[seriesIndex].min = value;
+                            xMarkMap[seriesIndex].minX = x;
+                            xMarkMap[seriesIndex].minY = y;
+                        }
+                        if (xMarkMap[seriesIndex].max < value) {
+                            xMarkMap[seriesIndex].max = value;
+                            xMarkMap[seriesIndex].maxX = x;
+                            xMarkMap[seriesIndex].maxY = y;
+                        }
+                        xMarkMap[seriesIndex].sum += value;
+                        xMarkMap[seriesIndex].counter++;
+                    }
+                }
+                lastXP = this.component.grid.getXend();
+                var symbolSize;
+                for (var j = 0, k = locationMap.length; j < k; j++) {
+                    for (var m = 0, n = locationMap[j].length; m < n; m++) {
+                        seriesIndex = locationMap[j][m];
+                        serie = series[seriesIndex];
+                        data = serie.data[i];
+                        value = this.getDataFromOption(data, '-');
+                        if (value != '-') {
+                            continue;
+                        }
+                        if (this.deepQuery([
+                                data,
+                                serie,
+                                this.option
+                            ], 'calculable')) {
+                            symbolSize = this.deepQuery([
+                                data,
+                                serie
+                            ], 'symbolSize');
+                            lastXP -= symbolSize * 2 + 5;
+                            x = lastXP;
+                            this.shapeList.push(this._getCalculableItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y, 'vertical'));
+                        }
+                    }
+                }
+            }
+            for (var sId in curPLMap) {
+                if (curPLMap[sId].length > 0) {
+                    this.finalPLMap[sId] = this.finalPLMap[sId] || [];
+                    this.finalPLMap[sId].push(curPLMap[sId]);
+                    curPLMap[sId] = [];
+                }
+            }
+            this._calculMarkMapXY(xMarkMap, locationMap, 'x');
+            this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical');
+        },
+        _buildOther: function (seriesArray, maxDataLength, locationMap, xMarkMap) {
+            var series = this.series;
+            var curPLMap = {};
+            var xAxis;
+            for (var j = 0, k = locationMap.length; j < k; j++) {
+                for (var m = 0, n = locationMap[j].length; m < n; m++) {
+                    var seriesIndex = locationMap[j][m];
+                    var serie = series[seriesIndex];
+                    xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0);
+                    var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0);
+                    var baseY = yAxis.getCoord(0);
+                    curPLMap[seriesIndex] = curPLMap[seriesIndex] || [];
+                    xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {
+                        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 i = 0, l = serie.data.length; i < l; i++) {
+                        var data = serie.data[i];
+                        var value = this.getDataFromOption(data, '-');
+                        if (!(value instanceof Array)) {
+                            continue;
+                        }
+                        var x = xAxis.getCoord(value[0]);
+                        var y = yAxis.getCoord(value[1]);
+                        curPLMap[seriesIndex].push([
+                            x,
+                            y,
+                            i,
+                            value[0],
+                            x,
+                            baseY
+                        ]);
+                        if (xMarkMap[seriesIndex].min0 > value[0]) {
+                            xMarkMap[seriesIndex].min0 = value[0];
+                            xMarkMap[seriesIndex].minY0 = y;
+                            xMarkMap[seriesIndex].minX0 = x;
+                        }
+                        if (xMarkMap[seriesIndex].max0 < value[0]) {
+                            xMarkMap[seriesIndex].max0 = value[0];
+                            xMarkMap[seriesIndex].maxY0 = y;
+                            xMarkMap[seriesIndex].maxX0 = x;
+                        }
+                        xMarkMap[seriesIndex].sum0 += value[0];
+                        xMarkMap[seriesIndex].counter0++;
+                        if (xMarkMap[seriesIndex].min1 > value[1]) {
+                            xMarkMap[seriesIndex].min1 = value[1];
+                            xMarkMap[seriesIndex].minY1 = y;
+                            xMarkMap[seriesIndex].minX1 = x;
+                        }
+                        if (xMarkMap[seriesIndex].max1 < value[1]) {
+                            xMarkMap[seriesIndex].max1 = value[1];
+                            xMarkMap[seriesIndex].maxY1 = y;
+                            xMarkMap[seriesIndex].maxX1 = x;
+                        }
+                        xMarkMap[seriesIndex].sum1 += value[1];
+                        xMarkMap[seriesIndex].counter1++;
+                    }
+                }
+            }
+            for (var sId in curPLMap) {
+                if (curPLMap[sId].length > 0) {
+                    this.finalPLMap[sId] = this.finalPLMap[sId] || [];
+                    this.finalPLMap[sId].push(curPLMap[sId]);
+                    curPLMap[sId] = [];
+                }
+            }
+            this._calculMarkMapXY(xMarkMap, locationMap, 'xy');
+            this._buildBorkenLine(seriesArray, this.finalPLMap, xAxis, 'other');
+        },
+        _buildBorkenLine: function (seriesArray, pointList, categoryAxis, curOrient) {
+            var orient = curOrient == 'other' ? 'horizontal' : curOrient;
+            var series = this.series;
+            var data;
+            for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) {
+                var seriesIndex = seriesArray[sIdx];
+                var serie = series[seriesIndex];
+                var seriesPL = pointList[seriesIndex];
+                if (serie.type === this.type && seriesPL != null) {
+                    var bbox = this._getBbox(seriesIndex, orient);
+                    var defaultColor = this._sIndex2ColorMap[seriesIndex];
+                    var lineWidth = this.query(serie, 'itemStyle.normal.lineStyle.width');
+                    var lineType = this.query(serie, 'itemStyle.normal.lineStyle.type');
+                    var lineColor = this.query(serie, 'itemStyle.normal.lineStyle.color');
+                    var normalColor = this.getItemStyleColor(this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1);
+                    var isFill = this.query(serie, 'itemStyle.normal.areaStyle') != null;
+                    var fillNormalColor = this.query(serie, 'itemStyle.normal.areaStyle.color');
+                    for (var i = 0, l = seriesPL.length; i < l; i++) {
+                        var singlePL = seriesPL[i];
+                        var isLarge = curOrient != 'other' && this._isLarge(orient, singlePL);
+                        if (!isLarge) {
+                            for (var j = 0, k = singlePL.length; j < k; j++) {
+                                data = serie.data[singlePL[j][2]];
+                                if (this.deepQuery([
+                                        data,
+                                        serie,
+                                        this.option
+                                    ], 'calculable') || this.deepQuery([
+                                        data,
+                                        serie
+                                    ], 'showAllSymbol') || categoryAxis.type === 'categoryAxis' && categoryAxis.isMainAxis(singlePL[j][2]) && this.deepQuery([
+                                        data,
+                                        serie
+                                    ], 'symbol') != 'none') {
+                                    this.shapeList.push(this._getSymbol(seriesIndex, singlePL[j][2], singlePL[j][3], singlePL[j][0], singlePL[j][1], orient));
+                                }
+                            }
+                        } else {
+                            singlePL = this._getLargePointList(orient, singlePL, serie.dataFilter);
+                        }
+                        var polylineShape = new PolylineShape({
+                            zlevel: serie.zlevel,
+                            z: serie.z,
+                            style: {
+                                miterLimit: lineWidth,
+                                pointList: singlePL,
+                                strokeColor: lineColor || normalColor || defaultColor,
+                                lineWidth: lineWidth,
+                                lineType: lineType,
+                                smooth: this._getSmooth(serie.smooth),
+                                smoothConstraint: bbox,
+                                shadowColor: this.query(serie, 'itemStyle.normal.lineStyle.shadowColor'),
+                                shadowBlur: this.query(serie, 'itemStyle.normal.lineStyle.shadowBlur'),
+                                shadowOffsetX: this.query(serie, 'itemStyle.normal.lineStyle.shadowOffsetX'),
+                                shadowOffsetY: this.query(serie, 'itemStyle.normal.lineStyle.shadowOffsetY')
+                            },
+                            hoverable: false,
+                            _main: true,
+                            _seriesIndex: seriesIndex,
+                            _orient: orient
+                        });
+                        ecData.pack(polylineShape, series[seriesIndex], seriesIndex, 0, i, series[seriesIndex].name);
+                        this.shapeList.push(polylineShape);
+                        if (isFill) {
+                            var halfSmoothPolygonShape = new HalfSmoothPolygonShape({
+                                zlevel: serie.zlevel,
+                                z: serie.z,
+                                style: {
+                                    miterLimit: lineWidth,
+                                    pointList: zrUtil.clone(singlePL).concat([
+                                        [
+                                            singlePL[singlePL.length - 1][4],
+                                            singlePL[singlePL.length - 1][5]
+                                        ],
+                                        [
+                                            singlePL[0][4],
+                                            singlePL[0][5]
+                                        ]
+                                    ]),
+                                    brushType: 'fill',
+                                    smooth: this._getSmooth(serie.smooth),
+                                    smoothConstraint: bbox,
+                                    color: fillNormalColor ? fillNormalColor : zrColor.alpha(defaultColor, 0.5)
+                                },
+                                highlightStyle: { brushType: 'fill' },
+                                hoverable: false,
+                                _main: true,
+                                _seriesIndex: seriesIndex,
+                                _orient: orient
+                            });
+                            ecData.pack(halfSmoothPolygonShape, series[seriesIndex], seriesIndex, 0, i, series[seriesIndex].name);
+                            this.shapeList.push(halfSmoothPolygonShape);
+                        }
+                    }
+                }
+            }
+        },
+        _getBbox: function (seriesIndex, orient) {
+            var bbox = this.component.grid.getBbox();
+            var xMarkMap = this.xMarkMap[seriesIndex];
+            if (xMarkMap.minX0 != null) {
+                return [
+                    [
+                        Math.min(xMarkMap.minX0, xMarkMap.maxX0, xMarkMap.minX1, xMarkMap.maxX1),
+                        Math.min(xMarkMap.minY0, xMarkMap.maxY0, xMarkMap.minY1, xMarkMap.maxY1)
+                    ],
+                    [
+                        Math.max(xMarkMap.minX0, xMarkMap.maxX0, xMarkMap.minX1, xMarkMap.maxX1),
+                        Math.max(xMarkMap.minY0, xMarkMap.maxY0, xMarkMap.minY1, xMarkMap.maxY1)
+                    ]
+                ];
+            } else if (orient === 'horizontal') {
+                bbox[0][1] = Math.min(xMarkMap.minY, xMarkMap.maxY);
+                bbox[1][1] = Math.max(xMarkMap.minY, xMarkMap.maxY);
+            } else {
+                bbox[0][0] = Math.min(xMarkMap.minX, xMarkMap.maxX);
+                bbox[1][0] = Math.max(xMarkMap.minX, xMarkMap.maxX);
+            }
+            return bbox;
+        },
+        _isLarge: function (orient, singlePL) {
+            if (singlePL.length < 2) {
+                return false;
+            } else {
+                return orient === 'horizontal' ? Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5 : Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5;
+            }
+        },
+        _getLargePointList: function (orient, singlePL, filter) {
+            var total;
+            if (orient === 'horizontal') {
+                total = this.component.grid.getWidth();
+            } else {
+                total = this.component.grid.getHeight();
+            }
+            var len = singlePL.length;
+            var newList = [];
+            if (typeof filter != 'function') {
+                switch (filter) {
+                case 'min':
+                    filter = function (arr) {
+                        return Math.max.apply(null, arr);
+                    };
+                    break;
+                case 'max':
+                    filter = function (arr) {
+                        return Math.min.apply(null, arr);
+                    };
+                    break;
+                case 'average':
+                    filter = function (arr) {
+                        var total = 0;
+                        for (var i = 0; i < arr.length; i++) {
+                            total += arr[i];
+                        }
+                        return total / arr.length;
+                    };
+                    break;
+                default:
+                    filter = function (arr) {
+                        return arr[0];
+                    };
+                }
+            }
+            var windowData = [];
+            for (var i = 0; i < total; i++) {
+                var idx0 = Math.floor(len / total * i);
+                var idx1 = Math.min(Math.floor(len / total * (i + 1)), len);
+                if (idx1 <= idx0) {
+                    continue;
+                }
+                for (var j = idx0; j < idx1; j++) {
+                    windowData[j - idx0] = orient === 'horizontal' ? singlePL[j][1] : singlePL[j][0];
+                }
+                windowData.length = idx1 - idx0;
+                var filteredVal = filter(windowData);
+                var nearestIdx = -1;
+                var minDist = Infinity;
+                for (var j = idx0; j < idx1; j++) {
+                    var val = orient === 'horizontal' ? singlePL[j][1] : singlePL[j][0];
+                    var dist = Math.abs(val - filteredVal);
+                    if (dist < minDist) {
+                        nearestIdx = j;
+                        minDist = dist;
+                    }
+                }
+                var newItem = singlePL[nearestIdx].slice();
+                if (orient === 'horizontal') {
+                    newItem[1] = filteredVal;
+                } else {
+                    newItem[0] = filteredVal;
+                }
+                newList.push(newItem);
+            }
+            return newList;
+        },
+        _getSmooth: function (isSmooth) {
+            if (isSmooth) {
+                return 0.3;
+            } else {
+                return 0;
+            }
+        },
+        _getCalculableItem: function (seriesIndex, dataIndex, name, x, y, orient) {
+            var series = this.series;
+            var color = series[seriesIndex].calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor;
+            var itemShape = this._getSymbol(seriesIndex, dataIndex, name, x, y, orient);
+            itemShape.style.color = color;
+            itemShape.style.strokeColor = color;
+            itemShape.rotation = [
+                0,
+                0
+            ];
+            itemShape.hoverable = false;
+            itemShape.draggable = false;
+            itemShape.style.text = undefined;
+            return itemShape;
+        },
+        _getSymbol: function (seriesIndex, dataIndex, name, x, y, orient) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var data = serie.data[dataIndex];
+            var itemShape = this.getSymbolShape(serie, seriesIndex, data, dataIndex, name, x, y, this._sIndex2ShapeMap[seriesIndex], this._sIndex2ColorMap[seriesIndex], '#fff', orient === 'vertical' ? 'horizontal' : 'vertical');
+            itemShape.zlevel = serie.zlevel;
+            itemShape.z = serie.z + 1;
+            if (this.deepQuery([
+                    data,
+                    serie,
+                    this.option
+                ], 'calculable')) {
+                this.setCalculable(itemShape);
+                itemShape.draggable = true;
+            }
+            return itemShape;
+        },
+        getMarkCoord: function (seriesIndex, mpData) {
+            var serie = this.series[seriesIndex];
+            var xMarkMap = this.xMarkMap[seriesIndex];
+            var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex);
+            var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex);
+            if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) {
+                var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : xMarkMap.maxX0 != null ? '1' : '';
+                return [
+                    xMarkMap[mpData.type + 'X' + valueIndex],
+                    xMarkMap[mpData.type + 'Y' + valueIndex],
+                    xMarkMap[mpData.type + 'Line' + valueIndex],
+                    xMarkMap[mpData.type + valueIndex]
+                ];
+            }
+            return [
+                typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0),
+                typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0)
+            ];
+        },
+        refresh: function (newOption) {
+            if (newOption) {
+                this.option = newOption;
+                this.series = newOption.series;
+            }
+            this.backupShapeList();
+            this._buildShape();
+        },
+        ontooltipHover: function (param, tipShape) {
+            var seriesIndex = param.seriesIndex;
+            var dataIndex = param.dataIndex;
+            var seriesPL;
+            var singlePL;
+            var len = seriesIndex.length;
+            while (len--) {
+                seriesPL = this.finalPLMap[seriesIndex[len]];
+                if (seriesPL) {
+                    for (var i = 0, l = seriesPL.length; i < l; i++) {
+                        singlePL = seriesPL[i];
+                        for (var j = 0, k = singlePL.length; j < k; j++) {
+                            if (dataIndex === singlePL[j][2]) {
+                                tipShape.push(this._getSymbol(seriesIndex[len], singlePL[j][2], singlePL[j][3], singlePL[j][0], singlePL[j][1], 'horizontal'));
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        addDataAnimation: function (params, done) {
+            var series = this.series;
+            var aniMap = {};
+            for (var i = 0, l = params.length; i < l; i++) {
+                aniMap[params[i][0]] = params[i];
+            }
+            var x;
+            var dx;
+            var y;
+            var dy;
+            var seriesIndex;
+            var pointList;
+            var isHorizontal;
+            var aniCount = 0;
+            function animationDone() {
+                aniCount--;
+                if (aniCount === 0) {
+                    done && done();
+                }
+            }
+            function animationDuring(target) {
+                target.style.controlPointList = null;
+            }
+            for (var i = this.shapeList.length - 1; i >= 0; i--) {
+                seriesIndex = this.shapeList[i]._seriesIndex;
+                if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) {
+                    if (this.shapeList[i]._main && this.shapeList[i].style.pointList.length > 1) {
+                        pointList = this.shapeList[i].style.pointList;
+                        dx = Math.abs(pointList[0][0] - pointList[1][0]);
+                        dy = Math.abs(pointList[0][1] - pointList[1][1]);
+                        isHorizontal = this.shapeList[i]._orient === 'horizontal';
+                        if (aniMap[seriesIndex][2]) {
+                            if (this.shapeList[i].type === 'half-smooth-polygon') {
+                                var len = pointList.length;
+                                this.shapeList[i].style.pointList[len - 3] = pointList[len - 2];
+                                this.shapeList[i].style.pointList[len - 3][isHorizontal ? 0 : 1] = pointList[len - 4][isHorizontal ? 0 : 1];
+                                this.shapeList[i].style.pointList[len - 2] = pointList[len - 1];
+                            }
+                            this.shapeList[i].style.pointList.pop();
+                            isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy);
+                        } else {
+                            this.shapeList[i].style.pointList.shift();
+                            if (this.shapeList[i].type === 'half-smooth-polygon') {
+                                var targetPoint = this.shapeList[i].style.pointList.pop();
+                                isHorizontal ? targetPoint[0] = pointList[0][0] : targetPoint[1] = pointList[0][1];
+                                this.shapeList[i].style.pointList.push(targetPoint);
+                            }
+                            isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy);
+                        }
+                        this.shapeList[i].style.controlPointList = null;
+                        this.zr.modShape(this.shapeList[i]);
+                    } else {
+                        if (aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex === series[seriesIndex].data.length - 1) {
+                            this.zr.delShape(this.shapeList[i].id);
+                            continue;
+                        } else if (!aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex === 0) {
+                            this.zr.delShape(this.shapeList[i].id);
+                            continue;
+                        }
+                    }
+                    this.shapeList[i].position = [
+                        0,
+                        0
+                    ];
+                    aniCount++;
+                    this.zr.animate(this.shapeList[i].id, '').when(this.query(this.option, 'animationDurationUpdate'), {
+                        position: [
+                            x,
+                            y
+                        ]
+                    }).during(animationDuring).done(animationDone).start();
+                }
+            }
+            if (!aniCount) {
+                done && done();
+            }
+        }
+    };
+    function legendLineIcon(ctx, style, refreshNextFrame) {
+        var x = style.x;
+        var y = style.y;
+        var width = style.width;
+        var height = style.height;
+        var dy = height / 2;
+        if (style.symbol.match('empty')) {
+            ctx.fillStyle = '#fff';
+        }
+        style.brushType = 'both';
+        var symbol = style.symbol.replace('empty', '').toLowerCase();
+        if (symbol.match('star')) {
+            dy = symbol.replace('star', '') - 0 || 5;
+            y -= 1;
+            symbol = 'star';
+        } else if (symbol === 'rectangle' || symbol === 'arrow') {
+            x += (width - height) / 2;
+            width = height;
+        }
+        var imageLocation = '';
+        if (symbol.match('image')) {
+            imageLocation = symbol.replace(new RegExp('^image:\\/\\/'), '');
+            symbol = 'image';
+            x += Math.round((width - height) / 2) - 1;
+            width = height = height + 2;
+        }
+        symbol = IconShape.prototype.iconLibrary[symbol];
+        if (symbol) {
+            var x2 = style.x;
+            var y2 = style.y;
+            ctx.moveTo(x2, y2 + dy);
+            ctx.lineTo(x2 + 5, y2 + dy);
+            ctx.moveTo(x2 + style.width - 5, y2 + dy);
+            ctx.lineTo(x2 + style.width, y2 + dy);
+            var self = this;
+            symbol(ctx, {
+                x: x + 4,
+                y: y + 4,
+                width: width - 8,
+                height: height - 8,
+                n: dy,
+                image: imageLocation
+            }, function () {
+                self.modSelf();
+                refreshNextFrame();
+            });
+        } else {
+            ctx.moveTo(x, y + dy);
+            ctx.lineTo(x + width, y + dy);
+        }
+    }
+    IconShape.prototype.iconLibrary['legendLineIcon'] = legendLineIcon;
+    zrUtil.inherits(Line, ChartBase);
+    require('../chart').define('line', Line);
+    return Line;
+});define('echarts/util/shape/HalfSmoothPolygon', [
+    'require',
+    'zrender/shape/Base',
+    'zrender/shape/util/smoothBezier',
+    'zrender/tool/util',
+    'zrender/shape/Polygon'
+], function (require) {
+    var Base = require('zrender/shape/Base');
+    var smoothBezier = require('zrender/shape/util/smoothBezier');
+    var zrUtil = require('zrender/tool/util');
+    function HalfSmoothPolygon(options) {
+        Base.call(this, options);
+    }
+    HalfSmoothPolygon.prototype = {
+        type: 'half-smooth-polygon',
+        buildPath: function (ctx, style) {
+            var pointList = style.pointList;
+            if (pointList.length < 2) {
+                return;
+            }
+            if (style.smooth) {
+                var controlPoints = smoothBezier(pointList.slice(0, -2), style.smooth, false, style.smoothConstraint);
+                ctx.moveTo(pointList[0][0], pointList[0][1]);
+                var cp1;
+                var cp2;
+                var p;
+                var l = pointList.length;
+                for (var i = 0; i < l - 3; i++) {
+                    cp1 = controlPoints[i * 2];
+                    cp2 = controlPoints[i * 2 + 1];
+                    p = pointList[i + 1];
+                    ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
+                }
+                ctx.lineTo(pointList[l - 2][0], pointList[l - 2][1]);
+                ctx.lineTo(pointList[l - 1][0], pointList[l - 1][1]);
+                ctx.lineTo(pointList[0][0], pointList[0][1]);
+            } else {
+                require('zrender/shape/Polygon').prototype.buildPath(ctx, style);
+            }
+            return;
+        }
+    };
+    zrUtil.inherits(HalfSmoothPolygon, Base);
+    return HalfSmoothPolygon;
+});

File diff suppressed because it is too large
+ 17866 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/map.js


+ 746 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/pie.js

@@ -0,0 +1,746 @@
+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 (require) {
+    var ChartBase = require('./base');
+    var TextShape = require('zrender/shape/Text');
+    var RingShape = require('zrender/shape/Ring');
+    var CircleShape = require('zrender/shape/Circle');
+    var SectorShape = require('zrender/shape/Sector');
+    var PolylineShape = require('zrender/shape/Polyline');
+    var ecConfig = require('../config');
+    ecConfig.pie = {
+        zlevel: 0,
+        z: 2,
+        clickable: true,
+        legendHoverLink: true,
+        center: [
+            '50%',
+            '50%'
+        ],
+        radius: [
+            0,
+            '75%'
+        ],
+        clockWise: true,
+        startAngle: 90,
+        minAngle: 0,
+        selectedOffset: 10,
+        itemStyle: {
+            normal: {
+                borderColor: 'rgba(0,0,0,0)',
+                borderWidth: 1,
+                label: {
+                    show: true,
+                    position: 'outer'
+                },
+                labelLine: {
+                    show: true,
+                    length: 20,
+                    lineStyle: {
+                        width: 1,
+                        type: 'solid'
+                    }
+                }
+            },
+            emphasis: {
+                borderColor: 'rgba(0,0,0,0)',
+                borderWidth: 1,
+                label: { show: false },
+                labelLine: {
+                    show: false,
+                    length: 20,
+                    lineStyle: {
+                        width: 1,
+                        type: 'solid'
+                    }
+                }
+            }
+        }
+    };
+    var ecData = require('../util/ecData');
+    var zrUtil = require('zrender/tool/util');
+    var zrMath = require('zrender/tool/math');
+    var zrColor = require('zrender/tool/color');
+    function Pie(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        var self = this;
+        self.shapeHandler.onmouseover = function (param) {
+            var shape = param.target;
+            var seriesIndex = ecData.get(shape, 'seriesIndex');
+            var dataIndex = ecData.get(shape, 'dataIndex');
+            var percent = ecData.get(shape, 'special');
+            var center = [
+                shape.style.x,
+                shape.style.y
+            ];
+            var startAngle = shape.style.startAngle;
+            var endAngle = shape.style.endAngle;
+            var midAngle = ((endAngle + startAngle) / 2 + 360) % 360;
+            var defaultColor = shape.highlightStyle.color;
+            var label = self.getLabel(seriesIndex, dataIndex, percent, center, midAngle, defaultColor, true);
+            if (label) {
+                self.zr.addHoverShape(label);
+            }
+            var labelLine = self.getLabelLine(seriesIndex, dataIndex, center, shape.style.r0, shape.style.r, midAngle, defaultColor, true);
+            if (labelLine) {
+                self.zr.addHoverShape(labelLine);
+            }
+        };
+        this.refresh(option);
+    }
+    Pie.prototype = {
+        type: ecConfig.CHART_TYPE_PIE,
+        _buildShape: function () {
+            var series = this.series;
+            var legend = this.component.legend;
+            this.selectedMap = {};
+            this._selected = {};
+            var center;
+            var radius;
+            var pieCase;
+            this._selectedMode = false;
+            var serieName;
+            for (var i = 0, l = series.length; i < l; i++) {
+                if (series[i].type === ecConfig.CHART_TYPE_PIE) {
+                    series[i] = this.reformOption(series[i]);
+                    this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink;
+                    serieName = series[i].name || '';
+                    this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true;
+                    if (!this.selectedMap[serieName]) {
+                        continue;
+                    }
+                    center = this.parseCenter(this.zr, series[i].center);
+                    radius = this.parseRadius(this.zr, series[i].radius);
+                    this._selectedMode = this._selectedMode || series[i].selectedMode;
+                    this._selected[i] = [];
+                    if (this.deepQuery([
+                            series[i],
+                            this.option
+                        ], 'calculable')) {
+                        pieCase = {
+                            zlevel: series[i].zlevel,
+                            z: series[i].z,
+                            hoverable: false,
+                            style: {
+                                x: center[0],
+                                y: center[1],
+                                r0: radius[0] <= 10 ? 0 : radius[0] - 10,
+                                r: radius[1] + 10,
+                                brushType: 'stroke',
+                                lineWidth: 1,
+                                strokeColor: series[i].calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor
+                            }
+                        };
+                        ecData.pack(pieCase, series[i], i, undefined, -1);
+                        this.setCalculable(pieCase);
+                        pieCase = radius[0] <= 10 ? new CircleShape(pieCase) : new RingShape(pieCase);
+                        this.shapeList.push(pieCase);
+                    }
+                    this._buildSinglePie(i);
+                    this.buildMark(i);
+                }
+            }
+            this.addShapeList();
+        },
+        _buildSinglePie: function (seriesIndex) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var data = serie.data;
+            var legend = this.component.legend;
+            var itemName;
+            var totalSelected = 0;
+            var totalSelectedValue0 = 0;
+            var totalValue = 0;
+            var maxValue = Number.NEGATIVE_INFINITY;
+            var singleShapeList = [];
+            for (var i = 0, l = data.length; i < l; i++) {
+                itemName = data[i].name;
+                this.selectedMap[itemName] = legend ? legend.isSelected(itemName) : true;
+                if (this.selectedMap[itemName] && !isNaN(data[i].value)) {
+                    if (+data[i].value !== 0) {
+                        totalSelected++;
+                    } else {
+                        totalSelectedValue0++;
+                    }
+                    totalValue += +data[i].value;
+                    maxValue = Math.max(maxValue, +data[i].value);
+                }
+            }
+            if (totalValue === 0) {
+                return;
+            }
+            var percent = 100;
+            var clockWise = serie.clockWise;
+            var startAngle = (serie.startAngle.toFixed(2) - 0 + 360) % 360;
+            var endAngle;
+            var minAngle = serie.minAngle || 0.01;
+            var totalAngle = 360 - minAngle * totalSelected - 0.01 * totalSelectedValue0;
+            var defaultColor;
+            var roseType = serie.roseType;
+            var center;
+            var radius;
+            var r0;
+            var r1;
+            for (var i = 0, l = data.length; i < l; i++) {
+                itemName = data[i].name;
+                if (!this.selectedMap[itemName] || isNaN(data[i].value)) {
+                    continue;
+                }
+                defaultColor = legend ? legend.getColor(itemName) : this.zr.getColor(i);
+                percent = data[i].value / totalValue;
+                if (roseType != 'area') {
+                    endAngle = clockWise ? startAngle - percent * totalAngle - (percent !== 0 ? minAngle : 0.01) : percent * totalAngle + startAngle + (percent !== 0 ? minAngle : 0.01);
+                } else {
+                    endAngle = clockWise ? startAngle - 360 / l : 360 / l + startAngle;
+                }
+                endAngle = endAngle.toFixed(2) - 0;
+                percent = (percent * 100).toFixed(2);
+                center = this.parseCenter(this.zr, serie.center);
+                radius = this.parseRadius(this.zr, serie.radius);
+                r0 = +radius[0];
+                r1 = +radius[1];
+                if (roseType === 'radius') {
+                    r1 = data[i].value / maxValue * (r1 - r0) * 0.8 + (r1 - r0) * 0.2 + r0;
+                } else if (roseType === 'area') {
+                    r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0;
+                }
+                if (clockWise) {
+                    var temp;
+                    temp = startAngle;
+                    startAngle = endAngle;
+                    endAngle = temp;
+                }
+                this._buildItem(singleShapeList, seriesIndex, i, percent, data[i].selected, center, r0, r1, startAngle, endAngle, defaultColor);
+                if (!clockWise) {
+                    startAngle = endAngle;
+                }
+            }
+            this._autoLabelLayout(singleShapeList, center, r1);
+            for (var i = 0, l = singleShapeList.length; i < l; i++) {
+                this.shapeList.push(singleShapeList[i]);
+            }
+            singleShapeList = null;
+        },
+        _buildItem: function (singleShapeList, seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor) {
+            var series = this.series;
+            var midAngle = ((endAngle + startAngle) / 2 + 360) % 360;
+            var sector = this.getSector(seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor);
+            ecData.pack(sector, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent);
+            singleShapeList.push(sector);
+            var label = this.getLabel(seriesIndex, dataIndex, percent, center, midAngle, defaultColor, false);
+            var labelLine = this.getLabelLine(seriesIndex, dataIndex, center, r0, r1, midAngle, defaultColor, false);
+            if (labelLine) {
+                ecData.pack(labelLine, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent);
+                singleShapeList.push(labelLine);
+            }
+            if (label) {
+                ecData.pack(label, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent);
+                label._labelLine = labelLine;
+                singleShapeList.push(label);
+            }
+        },
+        getSector: function (seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var data = serie.data[dataIndex];
+            var queryTarget = [
+                data,
+                serie
+            ];
+            var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {};
+            var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {};
+            var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor;
+            var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor);
+            var sector = {
+                zlevel: serie.zlevel,
+                z: serie.z,
+                clickable: this.deepQuery(queryTarget, 'clickable'),
+                style: {
+                    x: center[0],
+                    y: center[1],
+                    r0: r0,
+                    r: r1,
+                    startAngle: startAngle,
+                    endAngle: endAngle,
+                    brushType: 'both',
+                    color: normalColor,
+                    lineWidth: normal.borderWidth,
+                    strokeColor: normal.borderColor,
+                    lineJoin: 'round'
+                },
+                highlightStyle: {
+                    color: emphasisColor,
+                    lineWidth: emphasis.borderWidth,
+                    strokeColor: emphasis.borderColor,
+                    lineJoin: 'round'
+                },
+                _seriesIndex: seriesIndex,
+                _dataIndex: dataIndex
+            };
+            if (isSelected) {
+                var midAngle = ((sector.style.startAngle + sector.style.endAngle) / 2).toFixed(2) - 0;
+                sector.style._hasSelected = true;
+                sector.style._x = sector.style.x;
+                sector.style._y = sector.style.y;
+                var offset = this.query(serie, 'selectedOffset');
+                sector.style.x += zrMath.cos(midAngle, true) * offset;
+                sector.style.y -= zrMath.sin(midAngle, true) * offset;
+                this._selected[seriesIndex][dataIndex] = true;
+            } else {
+                this._selected[seriesIndex][dataIndex] = false;
+            }
+            if (this._selectedMode) {
+                sector.onclick = this.shapeHandler.onclick;
+            }
+            if (this.deepQuery([
+                    data,
+                    serie,
+                    this.option
+                ], 'calculable')) {
+                this.setCalculable(sector);
+                sector.draggable = true;
+            }
+            if (this._needLabel(serie, data, true) || this._needLabelLine(serie, data, true)) {
+                sector.onmouseover = this.shapeHandler.onmouseover;
+            }
+            sector = new SectorShape(sector);
+            return sector;
+        },
+        getLabel: function (seriesIndex, dataIndex, percent, center, midAngle, defaultColor, isEmphasis) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var data = serie.data[dataIndex];
+            if (!this._needLabel(serie, data, isEmphasis)) {
+                return;
+            }
+            var status = isEmphasis ? 'emphasis' : 'normal';
+            var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle);
+            var labelControl = itemStyle[status].label;
+            var textStyle = labelControl.textStyle || {};
+            var centerX = center[0];
+            var centerY = center[1];
+            var x;
+            var y;
+            var radius = this.parseRadius(this.zr, serie.radius);
+            var textAlign;
+            var textBaseline = 'middle';
+            labelControl.position = labelControl.position || itemStyle.normal.label.position;
+            if (labelControl.position === 'center') {
+                x = centerX;
+                y = centerY;
+                textAlign = 'center';
+            } else if (labelControl.position === 'inner' || labelControl.position === 'inside') {
+                radius = (radius[0] + radius[1]) * (labelControl.distance || 0.5);
+                x = Math.round(centerX + radius * zrMath.cos(midAngle, true));
+                y = Math.round(centerY - radius * zrMath.sin(midAngle, true));
+                defaultColor = '#fff';
+                textAlign = 'center';
+            } else {
+                radius = radius[1] - -itemStyle[status].labelLine.length;
+                x = Math.round(centerX + radius * zrMath.cos(midAngle, true));
+                y = Math.round(centerY - radius * zrMath.sin(midAngle, true));
+                textAlign = midAngle >= 90 && midAngle <= 270 ? 'right' : 'left';
+            }
+            if (labelControl.position != 'center' && labelControl.position != 'inner' && labelControl.position != 'inside') {
+                x += textAlign === 'left' ? 20 : -20;
+            }
+            data.__labelX = x - (textAlign === 'left' ? 5 : -5);
+            data.__labelY = y;
+            var ts = new TextShape({
+                zlevel: serie.zlevel,
+                z: serie.z + 1,
+                hoverable: false,
+                style: {
+                    x: x,
+                    y: y,
+                    color: textStyle.color || defaultColor,
+                    text: this.getLabelText(seriesIndex, dataIndex, percent, status),
+                    textAlign: textStyle.align || textAlign,
+                    textBaseline: textStyle.baseline || textBaseline,
+                    textFont: this.getFont(textStyle)
+                },
+                highlightStyle: { brushType: 'fill' }
+            });
+            ts._radius = radius;
+            ts._labelPosition = labelControl.position || 'outer';
+            ts._rect = ts.getRect(ts.style);
+            ts._seriesIndex = seriesIndex;
+            ts._dataIndex = dataIndex;
+            return ts;
+        },
+        getLabelText: function (seriesIndex, dataIndex, percent, status) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var data = serie.data[dataIndex];
+            var formatter = this.deepQuery([
+                data,
+                serie
+            ], 'itemStyle.' + status + '.label.formatter');
+            if (formatter) {
+                if (typeof formatter === 'function') {
+                    return formatter.call(this.myChart, {
+                        seriesIndex: seriesIndex,
+                        seriesName: serie.name || '',
+                        series: serie,
+                        dataIndex: dataIndex,
+                        data: data,
+                        name: data.name,
+                        value: data.value,
+                        percent: percent
+                    });
+                } else if (typeof formatter === 'string') {
+                    formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{d}', '{d0}');
+                    formatter = formatter.replace('{a0}', serie.name).replace('{b0}', data.name).replace('{c0}', data.value).replace('{d0}', percent);
+                    return formatter;
+                }
+            } else {
+                return data.name;
+            }
+        },
+        getLabelLine: function (seriesIndex, dataIndex, center, r0, r1, midAngle, defaultColor, isEmphasis) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var data = serie.data[dataIndex];
+            if (this._needLabelLine(serie, data, isEmphasis)) {
+                var status = isEmphasis ? 'emphasis' : 'normal';
+                var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle);
+                var labelLineControl = itemStyle[status].labelLine;
+                var lineStyle = labelLineControl.lineStyle || {};
+                var centerX = center[0];
+                var centerY = center[1];
+                var minRadius = r1;
+                var maxRadius = this.parseRadius(this.zr, serie.radius)[1] - -labelLineControl.length;
+                var cosValue = zrMath.cos(midAngle, true);
+                var sinValue = zrMath.sin(midAngle, true);
+                return new PolylineShape({
+                    zlevel: serie.zlevel,
+                    z: serie.z + 1,
+                    hoverable: false,
+                    style: {
+                        pointList: [
+                            [
+                                centerX + minRadius * cosValue,
+                                centerY - minRadius * sinValue
+                            ],
+                            [
+                                centerX + maxRadius * cosValue,
+                                centerY - maxRadius * sinValue
+                            ],
+                            [
+                                data.__labelX,
+                                data.__labelY
+                            ]
+                        ],
+                        strokeColor: lineStyle.color || defaultColor,
+                        lineType: lineStyle.type,
+                        lineWidth: lineStyle.width
+                    },
+                    _seriesIndex: seriesIndex,
+                    _dataIndex: dataIndex
+                });
+            } else {
+                return;
+            }
+        },
+        _needLabel: function (serie, data, isEmphasis) {
+            return this.deepQuery([
+                data,
+                serie
+            ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.label.show');
+        },
+        _needLabelLine: function (serie, data, isEmphasis) {
+            return this.deepQuery([
+                data,
+                serie
+            ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.labelLine.show');
+        },
+        _autoLabelLayout: function (sList, center, r) {
+            var leftList = [];
+            var rightList = [];
+            for (var i = 0, l = sList.length; i < l; i++) {
+                if (sList[i]._labelPosition === 'outer' || sList[i]._labelPosition === 'outside') {
+                    sList[i]._rect._y = sList[i]._rect.y;
+                    if (sList[i]._rect.x < center[0]) {
+                        leftList.push(sList[i]);
+                    } else {
+                        rightList.push(sList[i]);
+                    }
+                }
+            }
+            this._layoutCalculate(leftList, center, r, -1);
+            this._layoutCalculate(rightList, center, r, 1);
+        },
+        _layoutCalculate: function (tList, center, r, direction) {
+            tList.sort(function (a, b) {
+                return a._rect.y - b._rect.y;
+            });
+            function _changeDown(start, end, delta, direction) {
+                for (var j = start; j < end; j++) {
+                    tList[j]._rect.y += delta;
+                    tList[j].style.y += delta;
+                    if (tList[j]._labelLine) {
+                        tList[j]._labelLine.style.pointList[1][1] += delta;
+                        tList[j]._labelLine.style.pointList[2][1] += delta;
+                    }
+                    if (j > start && j + 1 < end && tList[j + 1]._rect.y > tList[j]._rect.y + tList[j]._rect.height) {
+                        _changeUp(j, delta / 2);
+                        return;
+                    }
+                }
+                _changeUp(end - 1, delta / 2);
+            }
+            function _changeUp(end, delta) {
+                for (var j = end; j >= 0; j--) {
+                    tList[j]._rect.y -= delta;
+                    tList[j].style.y -= delta;
+                    if (tList[j]._labelLine) {
+                        tList[j]._labelLine.style.pointList[1][1] -= delta;
+                        tList[j]._labelLine.style.pointList[2][1] -= delta;
+                    }
+                    if (j > 0 && tList[j]._rect.y > tList[j - 1]._rect.y + tList[j - 1]._rect.height) {
+                        break;
+                    }
+                }
+            }
+            function _changeX(sList, isDownList, center, r, direction) {
+                var x = center[0];
+                var y = center[1];
+                var deltaX;
+                var deltaY;
+                var length;
+                var lastDeltaX = direction > 0 ? isDownList ? Number.MAX_VALUE : 0 : isDownList ? Number.MAX_VALUE : 0;
+                for (var i = 0, l = sList.length; i < l; i++) {
+                    deltaY = Math.abs(sList[i]._rect.y - y);
+                    length = sList[i]._radius - r;
+                    deltaX = deltaY < r + length ? Math.sqrt((r + length + 20) * (r + length + 20) - Math.pow(sList[i]._rect.y - y, 2)) : Math.abs(sList[i]._rect.x + (direction > 0 ? 0 : sList[i]._rect.width) - x);
+                    if (isDownList && deltaX >= lastDeltaX) {
+                        deltaX = lastDeltaX - 10;
+                    }
+                    if (!isDownList && deltaX <= lastDeltaX) {
+                        deltaX = lastDeltaX + 10;
+                    }
+                    sList[i]._rect.x = sList[i].style.x = x + deltaX * direction;
+                    if (sList[i]._labelLine) {
+                        sList[i]._labelLine.style.pointList[2][0] = x + (deltaX - 5) * direction;
+                        sList[i]._labelLine.style.pointList[1][0] = x + (deltaX - 20) * direction;
+                    }
+                    lastDeltaX = deltaX;
+                }
+            }
+            var lastY = 0;
+            var delta;
+            var len = tList.length;
+            var upList = [];
+            var downList = [];
+            for (var i = 0; i < len; i++) {
+                delta = tList[i]._rect.y - lastY;
+                if (delta < 0) {
+                    _changeDown(i, len, -delta, direction);
+                }
+                lastY = tList[i]._rect.y + tList[i]._rect.height;
+            }
+            if (this.zr.getHeight() - lastY < 0) {
+                _changeUp(len - 1, lastY - this.zr.getHeight());
+            }
+            for (var i = 0; i < len; i++) {
+                if (tList[i]._rect.y >= center[1]) {
+                    downList.push(tList[i]);
+                } else {
+                    upList.push(tList[i]);
+                }
+            }
+            _changeX(downList, true, center, r, direction);
+            _changeX(upList, false, center, r, direction);
+        },
+        reformOption: function (opt) {
+            var _merge = zrUtil.merge;
+            opt = _merge(_merge(opt || {}, zrUtil.clone(this.ecTheme.pie || {})), zrUtil.clone(ecConfig.pie));
+            opt.itemStyle.normal.label.textStyle = this.getTextStyle(opt.itemStyle.normal.label.textStyle);
+            opt.itemStyle.emphasis.label.textStyle = this.getTextStyle(opt.itemStyle.emphasis.label.textStyle);
+            this.z = opt.z;
+            this.zlevel = opt.zlevel;
+            return opt;
+        },
+        refresh: function (newOption) {
+            if (newOption) {
+                this.option = newOption;
+                this.series = newOption.series;
+            }
+            this.backupShapeList();
+            this._buildShape();
+        },
+        addDataAnimation: function (params, done) {
+            var series = this.series;
+            var aniMap = {};
+            for (var i = 0, l = params.length; i < l; i++) {
+                aniMap[params[i][0]] = params[i];
+            }
+            var aniCount = 0;
+            function animationDone() {
+                aniCount--;
+                if (aniCount === 0) {
+                    done && done();
+                }
+            }
+            var sectorMap = {};
+            var textMap = {};
+            var lineMap = {};
+            var backupShapeList = this.shapeList;
+            this.shapeList = [];
+            var seriesIndex;
+            var isHead;
+            var dataGrow;
+            var deltaIdxMap = {};
+            for (var i = 0, l = params.length; i < l; i++) {
+                seriesIndex = params[i][0];
+                isHead = params[i][2];
+                dataGrow = params[i][3];
+                if (series[seriesIndex] && series[seriesIndex].type === ecConfig.CHART_TYPE_PIE) {
+                    if (isHead) {
+                        if (!dataGrow) {
+                            sectorMap[seriesIndex + '_' + series[seriesIndex].data.length] = 'delete';
+                        }
+                        deltaIdxMap[seriesIndex] = 1;
+                    } else {
+                        if (!dataGrow) {
+                            sectorMap[seriesIndex + '_-1'] = 'delete';
+                            deltaIdxMap[seriesIndex] = -1;
+                        } else {
+                            deltaIdxMap[seriesIndex] = 0;
+                        }
+                    }
+                    this._buildSinglePie(seriesIndex);
+                }
+            }
+            var dataIndex;
+            var key;
+            for (var i = 0, l = this.shapeList.length; i < l; i++) {
+                seriesIndex = this.shapeList[i]._seriesIndex;
+                dataIndex = this.shapeList[i]._dataIndex;
+                key = seriesIndex + '_' + dataIndex;
+                switch (this.shapeList[i].type) {
+                case 'sector':
+                    sectorMap[key] = this.shapeList[i];
+                    break;
+                case 'text':
+                    textMap[key] = this.shapeList[i];
+                    break;
+                case 'polyline':
+                    lineMap[key] = this.shapeList[i];
+                    break;
+                }
+            }
+            this.shapeList = [];
+            var targeSector;
+            for (var i = 0, l = backupShapeList.length; i < l; i++) {
+                seriesIndex = backupShapeList[i]._seriesIndex;
+                if (aniMap[seriesIndex]) {
+                    dataIndex = backupShapeList[i]._dataIndex + deltaIdxMap[seriesIndex];
+                    key = seriesIndex + '_' + dataIndex;
+                    targeSector = sectorMap[key];
+                    if (!targeSector) {
+                        continue;
+                    }
+                    if (backupShapeList[i].type === 'sector') {
+                        if (targeSector != 'delete') {
+                            aniCount++;
+                            this.zr.animate(backupShapeList[i].id, 'style').when(400, {
+                                startAngle: targeSector.style.startAngle,
+                                endAngle: targeSector.style.endAngle
+                            }).done(animationDone).start();
+                        } else {
+                            aniCount++;
+                            this.zr.animate(backupShapeList[i].id, 'style').when(400, deltaIdxMap[seriesIndex] < 0 ? { startAngle: backupShapeList[i].style.startAngle } : { endAngle: backupShapeList[i].style.endAngle }).done(animationDone).start();
+                        }
+                    } else if (backupShapeList[i].type === 'text' || backupShapeList[i].type === 'polyline') {
+                        if (targeSector === 'delete') {
+                            this.zr.delShape(backupShapeList[i].id);
+                        } else {
+                            switch (backupShapeList[i].type) {
+                            case 'text':
+                                aniCount++;
+                                targeSector = textMap[key];
+                                this.zr.animate(backupShapeList[i].id, 'style').when(400, {
+                                    x: targeSector.style.x,
+                                    y: targeSector.style.y
+                                }).done(animationDone).start();
+                                break;
+                            case 'polyline':
+                                aniCount++;
+                                targeSector = lineMap[key];
+                                this.zr.animate(backupShapeList[i].id, 'style').when(400, { pointList: targeSector.style.pointList }).done(animationDone).start();
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+            this.shapeList = backupShapeList;
+            if (!aniCount) {
+                done && done();
+            }
+        },
+        onclick: function (param) {
+            var series = this.series;
+            if (!this.isClick || !param.target) {
+                return;
+            }
+            this.isClick = false;
+            var offset;
+            var target = param.target;
+            var style = target.style;
+            var seriesIndex = ecData.get(target, 'seriesIndex');
+            var dataIndex = ecData.get(target, 'dataIndex');
+            for (var i = 0, len = this.shapeList.length; i < len; i++) {
+                if (this.shapeList[i].id === target.id) {
+                    seriesIndex = ecData.get(target, 'seriesIndex');
+                    dataIndex = ecData.get(target, 'dataIndex');
+                    if (!style._hasSelected) {
+                        var midAngle = ((style.startAngle + style.endAngle) / 2).toFixed(2) - 0;
+                        target.style._hasSelected = true;
+                        this._selected[seriesIndex][dataIndex] = true;
+                        target.style._x = target.style.x;
+                        target.style._y = target.style.y;
+                        offset = this.query(series[seriesIndex], 'selectedOffset');
+                        target.style.x += zrMath.cos(midAngle, true) * offset;
+                        target.style.y -= zrMath.sin(midAngle, true) * offset;
+                    } else {
+                        target.style.x = target.style._x;
+                        target.style.y = target.style._y;
+                        target.style._hasSelected = false;
+                        this._selected[seriesIndex][dataIndex] = false;
+                    }
+                    this.zr.modShape(target.id);
+                } else if (this.shapeList[i].style._hasSelected && this._selectedMode === 'single') {
+                    seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex');
+                    dataIndex = ecData.get(this.shapeList[i], 'dataIndex');
+                    this.shapeList[i].style.x = this.shapeList[i].style._x;
+                    this.shapeList[i].style.y = this.shapeList[i].style._y;
+                    this.shapeList[i].style._hasSelected = false;
+                    this._selected[seriesIndex][dataIndex] = false;
+                    this.zr.modShape(this.shapeList[i].id);
+                }
+            }
+            this.messageCenter.dispatch(ecConfig.EVENT.PIE_SELECTED, param.event, {
+                selected: this._selected,
+                target: ecData.get(target, 'name')
+            }, this.myChart);
+            this.zr.refreshNextFrame();
+        }
+    };
+    zrUtil.inherits(Pie, ChartBase);
+    require('../chart').define('pie', Pie);
+    return Pie;
+});

+ 942 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/radar.js

@@ -0,0 +1,942 @@
+define('echarts/chart/radar', [
+    'require',
+    './base',
+    'zrender/shape/Polygon',
+    '../component/polar',
+    '../config',
+    '../util/ecData',
+    'zrender/tool/util',
+    'zrender/tool/color',
+    '../util/accMath',
+    '../chart'
+], function (require) {
+    var ChartBase = require('./base');
+    var PolygonShape = require('zrender/shape/Polygon');
+    require('../component/polar');
+    var ecConfig = require('../config');
+    ecConfig.radar = {
+        zlevel: 0,
+        z: 2,
+        clickable: true,
+        legendHoverLink: true,
+        polarIndex: 0,
+        itemStyle: {
+            normal: {
+                label: { show: false },
+                lineStyle: {
+                    width: 2,
+                    type: 'solid'
+                }
+            },
+            emphasis: { label: { show: false } }
+        },
+        symbolSize: 2
+    };
+    var ecData = require('../util/ecData');
+    var zrUtil = require('zrender/tool/util');
+    var zrColor = require('zrender/tool/color');
+    function Radar(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        this.refresh(option);
+    }
+    Radar.prototype = {
+        type: ecConfig.CHART_TYPE_RADAR,
+        _buildShape: function () {
+            this.selectedMap = {};
+            this._symbol = this.option.symbolList;
+            this._queryTarget;
+            this._dropBoxList = [];
+            this._radarDataCounter = 0;
+            var series = this.series;
+            var legend = this.component.legend;
+            var serieName;
+            for (var i = 0, l = series.length; i < l; i++) {
+                if (series[i].type === ecConfig.CHART_TYPE_RADAR) {
+                    this.serie = this.reformOption(series[i]);
+                    this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink;
+                    serieName = this.serie.name || '';
+                    this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true;
+                    if (this.selectedMap[serieName]) {
+                        this._queryTarget = [
+                            this.serie,
+                            this.option
+                        ];
+                        if (this.deepQuery(this._queryTarget, 'calculable')) {
+                            this._addDropBox(i);
+                        }
+                        this._buildSingleRadar(i);
+                        this.buildMark(i);
+                    }
+                }
+            }
+            this.addShapeList();
+        },
+        _buildSingleRadar: function (index) {
+            var legend = this.component.legend;
+            var iconShape;
+            var data = this.serie.data;
+            var defaultColor;
+            var name;
+            var pointList;
+            var calculable = this.deepQuery(this._queryTarget, 'calculable');
+            for (var i = 0; i < data.length; i++) {
+                name = data[i].name || '';
+                this.selectedMap[name] = legend ? legend.isSelected(name) : true;
+                if (!this.selectedMap[name]) {
+                    continue;
+                }
+                if (legend) {
+                    defaultColor = legend.getColor(name);
+                    iconShape = legend.getItemShape(name);
+                    if (iconShape) {
+                        iconShape.style.brushType = this.deepQuery([
+                            data[i],
+                            this.serie
+                        ], 'itemStyle.normal.areaStyle') ? 'both' : 'stroke';
+                        legend.setItemShape(name, iconShape);
+                    }
+                } else {
+                    defaultColor = this.zr.getColor(i);
+                }
+                pointList = this._getPointList(this.serie.polarIndex, data[i]);
+                this._addSymbol(pointList, defaultColor, i, index, this.serie.polarIndex);
+                this._addDataShape(pointList, defaultColor, data[i], index, i, calculable);
+                this._radarDataCounter++;
+            }
+        },
+        _getPointList: function (polarIndex, dataArr) {
+            var pointList = [];
+            var vector;
+            var polar = this.component.polar;
+            var value;
+            for (var i = 0, l = dataArr.value.length; i < l; i++) {
+                value = this.getDataFromOption(dataArr.value[i]);
+                vector = value != '-' ? polar.getVector(polarIndex, i, value) : false;
+                if (vector) {
+                    pointList.push(vector);
+                }
+            }
+            return pointList;
+        },
+        _addSymbol: function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) {
+            var series = this.series;
+            var itemShape;
+            var polar = this.component.polar;
+            for (var i = 0, l = pointList.length; i < l; i++) {
+                itemShape = this.getSymbolShape(this.deepMerge([
+                    series[seriesIndex].data[dataIndex],
+                    series[seriesIndex]
+                ]), seriesIndex, series[seriesIndex].data[dataIndex].value[i], i, polar.getIndicatorText(polarIndex, i), pointList[i][0], pointList[i][1], this._symbol[this._radarDataCounter % this._symbol.length], defaultColor, '#fff', 'vertical');
+                itemShape.zlevel = this.getZlevelBase();
+                itemShape.z = this.getZBase() + 1;
+                ecData.set(itemShape, 'data', series[seriesIndex].data[dataIndex]);
+                ecData.set(itemShape, 'value', series[seriesIndex].data[dataIndex].value);
+                ecData.set(itemShape, 'dataIndex', dataIndex);
+                ecData.set(itemShape, 'special', i);
+                this.shapeList.push(itemShape);
+            }
+        },
+        _addDataShape: function (pointList, defaultColor, data, seriesIndex, dataIndex, calculable) {
+            var series = this.series;
+            var queryTarget = [
+                data,
+                this.serie
+            ];
+            var nColor = this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.normal.color'), seriesIndex, dataIndex, data);
+            var nLineWidth = this.deepQuery(queryTarget, 'itemStyle.normal.lineStyle.width');
+            var nLineType = this.deepQuery(queryTarget, 'itemStyle.normal.lineStyle.type');
+            var nAreaColor = this.deepQuery(queryTarget, 'itemStyle.normal.areaStyle.color');
+            var nIsAreaFill = this.deepQuery(queryTarget, 'itemStyle.normal.areaStyle');
+            var shape = {
+                zlevel: this.getZlevelBase(),
+                z: this.getZBase(),
+                style: {
+                    pointList: pointList,
+                    brushType: nIsAreaFill ? 'both' : 'stroke',
+                    color: nAreaColor || nColor || (typeof defaultColor === 'string' ? zrColor.alpha(defaultColor, 0.5) : defaultColor),
+                    strokeColor: nColor || defaultColor,
+                    lineWidth: nLineWidth,
+                    lineType: nLineType
+                },
+                highlightStyle: {
+                    brushType: this.deepQuery(queryTarget, 'itemStyle.emphasis.areaStyle') || nIsAreaFill ? 'both' : 'stroke',
+                    color: this.deepQuery(queryTarget, 'itemStyle.emphasis.areaStyle.color') || nAreaColor || nColor || (typeof defaultColor === 'string' ? zrColor.alpha(defaultColor, 0.5) : defaultColor),
+                    strokeColor: this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), seriesIndex, dataIndex, data) || nColor || defaultColor,
+                    lineWidth: this.deepQuery(queryTarget, 'itemStyle.emphasis.lineStyle.width') || nLineWidth,
+                    lineType: this.deepQuery(queryTarget, 'itemStyle.emphasis.lineStyle.type') || nLineType
+                }
+            };
+            ecData.pack(shape, series[seriesIndex], seriesIndex, data, dataIndex, data.name, this.component.polar.getIndicator(series[seriesIndex].polarIndex));
+            if (calculable) {
+                shape.draggable = true;
+                this.setCalculable(shape);
+            }
+            shape = new PolygonShape(shape);
+            this.shapeList.push(shape);
+        },
+        _addDropBox: function (index) {
+            var series = this.series;
+            var polarIndex = this.deepQuery(this._queryTarget, 'polarIndex');
+            if (!this._dropBoxList[polarIndex]) {
+                var shape = this.component.polar.getDropBox(polarIndex);
+                shape.zlevel = this.getZlevelBase();
+                shape.z = this.getZBase();
+                this.setCalculable(shape);
+                ecData.pack(shape, series, index, undefined, -1);
+                this.shapeList.push(shape);
+                this._dropBoxList[polarIndex] = true;
+            }
+        },
+        ondragend: function (param, status) {
+            var series = this.series;
+            if (!this.isDragend || !param.target) {
+                return;
+            }
+            var target = param.target;
+            var seriesIndex = ecData.get(target, 'seriesIndex');
+            var dataIndex = ecData.get(target, 'dataIndex');
+            this.component.legend && this.component.legend.del(series[seriesIndex].data[dataIndex].name);
+            series[seriesIndex].data.splice(dataIndex, 1);
+            status.dragOut = true;
+            status.needRefresh = true;
+            this.isDragend = false;
+            return;
+        },
+        ondrop: function (param, status) {
+            var series = this.series;
+            if (!this.isDrop || !param.target) {
+                return;
+            }
+            var target = param.target;
+            var dragged = param.dragged;
+            var seriesIndex = ecData.get(target, 'seriesIndex');
+            var dataIndex = ecData.get(target, 'dataIndex');
+            var data;
+            var legend = this.component.legend;
+            var value;
+            if (dataIndex === -1) {
+                data = {
+                    value: ecData.get(dragged, 'value'),
+                    name: ecData.get(dragged, 'name')
+                };
+                series[seriesIndex].data.push(data);
+                legend && legend.add(data.name, dragged.style.color || dragged.style.strokeColor);
+            } else {
+                var accMath = require('../util/accMath');
+                data = series[seriesIndex].data[dataIndex];
+                legend && legend.del(data.name);
+                data.name += this.option.nameConnector + ecData.get(dragged, 'name');
+                value = ecData.get(dragged, 'value');
+                for (var i = 0; i < value.length; i++) {
+                    data.value[i] = accMath.accAdd(data.value[i], value[i]);
+                }
+                legend && legend.add(data.name, dragged.style.color || dragged.style.strokeColor);
+            }
+            status.dragIn = status.dragIn || true;
+            this.isDrop = false;
+            return;
+        },
+        refresh: function (newOption) {
+            if (newOption) {
+                this.option = newOption;
+                this.series = newOption.series;
+            }
+            this.backupShapeList();
+            this._buildShape();
+        }
+    };
+    zrUtil.inherits(Radar, ChartBase);
+    require('../chart').define('radar', Radar);
+    return Radar;
+});define('echarts/component/polar', [
+    'require',
+    './base',
+    'zrender/shape/Text',
+    'zrender/shape/Line',
+    'zrender/shape/Polygon',
+    'zrender/shape/Circle',
+    'zrender/shape/Ring',
+    '../config',
+    'zrender/tool/util',
+    '../util/coordinates',
+    '../util/accMath',
+    '../util/smartSteps',
+    '../component'
+], function (require) {
+    var Base = require('./base');
+    var TextShape = require('zrender/shape/Text');
+    var LineShape = require('zrender/shape/Line');
+    var PolygonShape = require('zrender/shape/Polygon');
+    var Circle = require('zrender/shape/Circle');
+    var Ring = require('zrender/shape/Ring');
+    var ecConfig = require('../config');
+    ecConfig.polar = {
+        zlevel: 0,
+        z: 0,
+        center: [
+            '50%',
+            '50%'
+        ],
+        radius: '75%',
+        startAngle: 90,
+        boundaryGap: [
+            0,
+            0
+        ],
+        splitNumber: 5,
+        name: {
+            show: true,
+            textStyle: { color: '#333' }
+        },
+        axisLine: {
+            show: true,
+            lineStyle: {
+                color: '#ccc',
+                width: 1,
+                type: 'solid'
+            }
+        },
+        axisLabel: {
+            show: false,
+            textStyle: { color: '#333' }
+        },
+        splitArea: {
+            show: true,
+            areaStyle: {
+                color: [
+                    'rgba(250,250,250,0.3)',
+                    'rgba(200,200,200,0.3)'
+                ]
+            }
+        },
+        splitLine: {
+            show: true,
+            lineStyle: {
+                width: 1,
+                color: '#ccc'
+            }
+        },
+        type: 'polygon'
+    };
+    var zrUtil = require('zrender/tool/util');
+    var ecCoordinates = require('../util/coordinates');
+    function Polar(ecTheme, messageCenter, zr, option, myChart) {
+        Base.call(this, ecTheme, messageCenter, zr, option, myChart);
+        this.refresh(option);
+    }
+    Polar.prototype = {
+        type: ecConfig.COMPONENT_TYPE_POLAR,
+        _buildShape: function () {
+            for (var i = 0; i < this.polar.length; i++) {
+                this._index = i;
+                this.reformOption(this.polar[i]);
+                this._queryTarget = [
+                    this.polar[i],
+                    this.option
+                ];
+                this._createVector(i);
+                this._buildSpiderWeb(i);
+                this._buildText(i);
+                this._adjustIndicatorValue(i);
+                this._addAxisLabel(i);
+            }
+            for (var i = 0; i < this.shapeList.length; i++) {
+                this.zr.addShape(this.shapeList[i]);
+            }
+        },
+        _createVector: function (index) {
+            var item = this.polar[index];
+            var indicator = this.deepQuery(this._queryTarget, 'indicator');
+            var length = indicator.length;
+            var startAngle = item.startAngle;
+            var dStep = 2 * Math.PI / length;
+            var radius = this._getRadius();
+            var __ecIndicator = item.__ecIndicator = [];
+            var vector;
+            for (var i = 0; i < length; i++) {
+                vector = ecCoordinates.polar2cartesian(radius, startAngle * Math.PI / 180 + dStep * i);
+                __ecIndicator.push({
+                    vector: [
+                        vector[1],
+                        -vector[0]
+                    ]
+                });
+            }
+        },
+        _getRadius: function () {
+            var item = this.polar[this._index];
+            return this.parsePercent(item.radius, Math.min(this.zr.getWidth(), this.zr.getHeight()) / 2);
+        },
+        _buildSpiderWeb: function (index) {
+            var item = this.polar[index];
+            var __ecIndicator = item.__ecIndicator;
+            var splitArea = item.splitArea;
+            var splitLine = item.splitLine;
+            var center = this.getCenter(index);
+            var splitNumber = item.splitNumber;
+            var strokeColor = splitLine.lineStyle.color;
+            var lineWidth = splitLine.lineStyle.width;
+            var show = splitLine.show;
+            var axisLine = this.deepQuery(this._queryTarget, 'axisLine');
+            this._addArea(__ecIndicator, splitNumber, center, splitArea, strokeColor, lineWidth, show);
+            axisLine.show && this._addLine(__ecIndicator, center, axisLine);
+        },
+        _addAxisLabel: function (index) {
+            var accMath = require('../util/accMath');
+            var item = this.polar[index];
+            var indicator = this.deepQuery(this._queryTarget, 'indicator');
+            var __ecIndicator = item.__ecIndicator;
+            var axisLabel;
+            var vector;
+            var style;
+            var newStyle;
+            var splitNumber = this.deepQuery(this._queryTarget, 'splitNumber');
+            var center = this.getCenter(index);
+            var vector;
+            var value;
+            var text;
+            var theta;
+            var offset;
+            var interval;
+            for (var i = 0; i < indicator.length; i++) {
+                axisLabel = this.deepQuery([
+                    indicator[i],
+                    item,
+                    this.option
+                ], 'axisLabel');
+                if (axisLabel.show) {
+                    var textStyle = this.deepQuery([
+                        axisLabel,
+                        item,
+                        this.option
+                    ], 'textStyle');
+                    var formatter = this.deepQuery([
+                        axisLabel,
+                        item
+                    ], 'formatter');
+                    style = {};
+                    style.textFont = this.getFont(textStyle);
+                    style.color = textStyle.color;
+                    style = zrUtil.merge(style, axisLabel);
+                    style.lineWidth = style.width;
+                    vector = __ecIndicator[i].vector;
+                    value = __ecIndicator[i].value;
+                    theta = i / indicator.length * 2 * Math.PI;
+                    offset = axisLabel.offset || 10;
+                    interval = axisLabel.interval || 0;
+                    if (!value) {
+                        return;
+                    }
+                    for (var j = 1; j <= splitNumber; j += interval + 1) {
+                        newStyle = zrUtil.merge({}, style);
+                        text = accMath.accAdd(value.min, accMath.accMul(value.step, j));
+                        if (typeof formatter === 'function') {
+                            text = formatter(text);
+                        } else if (typeof formatter === 'string') {
+                            text = formatter.replace('{a}', '{a0}').replace('{a0}', text);
+                        } else {
+                            text = this.numAddCommas(text);
+                        }
+                        newStyle.text = text;
+                        newStyle.x = j * vector[0] / splitNumber + Math.cos(theta) * offset + center[0];
+                        newStyle.y = j * vector[1] / splitNumber + Math.sin(theta) * offset + center[1];
+                        this.shapeList.push(new TextShape({
+                            zlevel: this.getZlevelBase(),
+                            z: this.getZBase(),
+                            style: newStyle,
+                            draggable: false,
+                            hoverable: false
+                        }));
+                    }
+                }
+            }
+        },
+        _buildText: function (index) {
+            var item = this.polar[index];
+            var __ecIndicator = item.__ecIndicator;
+            var vector;
+            var indicator = this.deepQuery(this._queryTarget, 'indicator');
+            var center = this.getCenter(index);
+            var style;
+            var textAlign;
+            var name;
+            var rotation;
+            var x = 0;
+            var y = 0;
+            var margin;
+            var textStyle;
+            for (var i = 0; i < indicator.length; i++) {
+                name = this.deepQuery([
+                    indicator[i],
+                    item,
+                    this.option
+                ], 'name');
+                if (!name.show) {
+                    continue;
+                }
+                textStyle = this.deepQuery([
+                    name,
+                    item,
+                    this.option
+                ], 'textStyle');
+                style = {};
+                style.textFont = this.getFont(textStyle);
+                style.color = textStyle.color;
+                if (typeof name.formatter == 'function') {
+                    style.text = name.formatter.call(this.myChart, indicator[i].text, i);
+                } else if (typeof name.formatter == 'string') {
+                    style.text = name.formatter.replace('{value}', indicator[i].text);
+                } else {
+                    style.text = indicator[i].text;
+                }
+                __ecIndicator[i].text = style.text;
+                vector = __ecIndicator[i].vector;
+                if (Math.round(vector[0]) > 0) {
+                    textAlign = 'left';
+                } else if (Math.round(vector[0]) < 0) {
+                    textAlign = 'right';
+                } else {
+                    textAlign = 'center';
+                }
+                if (name.margin == null) {
+                    vector = this._mapVector(vector, center, 1.1);
+                } else {
+                    margin = name.margin;
+                    x = vector[0] > 0 ? margin : -margin;
+                    y = vector[1] > 0 ? margin : -margin;
+                    x = vector[0] === 0 ? 0 : x;
+                    y = vector[1] === 0 ? 0 : y;
+                    vector = this._mapVector(vector, center, 1);
+                }
+                style.textAlign = textAlign;
+                style.x = vector[0] + x;
+                style.y = vector[1] + y;
+                if (name.rotate) {
+                    rotation = [
+                        name.rotate / 180 * Math.PI,
+                        vector[0],
+                        vector[1]
+                    ];
+                } else {
+                    rotation = [
+                        0,
+                        0,
+                        0
+                    ];
+                }
+                this.shapeList.push(new TextShape({
+                    zlevel: this.getZlevelBase(),
+                    z: this.getZBase(),
+                    style: style,
+                    draggable: false,
+                    hoverable: false,
+                    rotation: rotation
+                }));
+            }
+        },
+        getIndicatorText: function (polarIndex, indicatorIndex) {
+            return this.polar[polarIndex] && this.polar[polarIndex].__ecIndicator[indicatorIndex] && this.polar[polarIndex].__ecIndicator[indicatorIndex].text;
+        },
+        getDropBox: function (index) {
+            var index = index || 0;
+            var item = this.polar[index];
+            var center = this.getCenter(index);
+            var __ecIndicator = item.__ecIndicator;
+            var len = __ecIndicator.length;
+            var pointList = [];
+            var vector;
+            var shape;
+            var type = item.type;
+            if (type == 'polygon') {
+                for (var i = 0; i < len; i++) {
+                    vector = __ecIndicator[i].vector;
+                    pointList.push(this._mapVector(vector, center, 1.2));
+                }
+                shape = this._getShape(pointList, 'fill', 'rgba(0,0,0,0)', '', 1);
+            } else if (type == 'circle') {
+                shape = this._getCircle('', 1, 1.2, center, 'fill', 'rgba(0,0,0,0)');
+            }
+            return shape;
+        },
+        _addArea: function (__ecIndicator, splitNumber, center, splitArea, strokeColor, lineWidth, show) {
+            var shape;
+            var scale;
+            var scale1;
+            var pointList;
+            var type = this.deepQuery(this._queryTarget, 'type');
+            for (var i = 0; i < splitNumber; i++) {
+                scale = (splitNumber - i) / splitNumber;
+                if (show) {
+                    if (type == 'polygon') {
+                        pointList = this._getPointList(__ecIndicator, scale, center);
+                        shape = this._getShape(pointList, 'stroke', '', strokeColor, lineWidth);
+                    } else if (type == 'circle') {
+                        shape = this._getCircle(strokeColor, lineWidth, scale, center, 'stroke');
+                    }
+                    this.shapeList.push(shape);
+                }
+                if (splitArea.show) {
+                    scale1 = (splitNumber - i - 1) / splitNumber;
+                    this._addSplitArea(__ecIndicator, splitArea, scale, scale1, center, i);
+                }
+            }
+        },
+        _getCircle: function (strokeColor, lineWidth, scale, center, brushType, color) {
+            var radius = this._getRadius();
+            return new Circle({
+                zlevel: this.getZlevelBase(),
+                z: this.getZBase(),
+                style: {
+                    x: center[0],
+                    y: center[1],
+                    r: radius * scale,
+                    brushType: brushType,
+                    strokeColor: strokeColor,
+                    lineWidth: lineWidth,
+                    color: color
+                },
+                hoverable: false,
+                draggable: false
+            });
+        },
+        _getRing: function (color, scale0, scale1, center) {
+            var radius = this._getRadius();
+            return new Ring({
+                zlevel: this.getZlevelBase(),
+                z: this.getZBase(),
+                style: {
+                    x: center[0],
+                    y: center[1],
+                    r: scale0 * radius,
+                    r0: scale1 * radius,
+                    color: color,
+                    brushType: 'fill'
+                },
+                hoverable: false,
+                draggable: false
+            });
+        },
+        _getPointList: function (__ecIndicator, scale, center) {
+            var pointList = [];
+            var len = __ecIndicator.length;
+            var vector;
+            for (var i = 0; i < len; i++) {
+                vector = __ecIndicator[i].vector;
+                pointList.push(this._mapVector(vector, center, scale));
+            }
+            return pointList;
+        },
+        _getShape: function (pointList, brushType, color, strokeColor, lineWidth) {
+            return new PolygonShape({
+                zlevel: this.getZlevelBase(),
+                z: this.getZBase(),
+                style: {
+                    pointList: pointList,
+                    brushType: brushType,
+                    color: color,
+                    strokeColor: strokeColor,
+                    lineWidth: lineWidth
+                },
+                hoverable: false,
+                draggable: false
+            });
+        },
+        _addSplitArea: function (__ecIndicator, splitArea, scale, scale1, center, colorInd) {
+            var indLen = __ecIndicator.length;
+            var color;
+            var colorArr = splitArea.areaStyle.color;
+            var colorLen;
+            var vector;
+            var vector1;
+            var pointList = [];
+            var indLen = __ecIndicator.length;
+            var shape;
+            var type = this.deepQuery(this._queryTarget, 'type');
+            if (typeof colorArr == 'string') {
+                colorArr = [colorArr];
+            }
+            colorLen = colorArr.length;
+            color = colorArr[colorInd % colorLen];
+            if (type == 'polygon') {
+                for (var i = 0; i < indLen; i++) {
+                    pointList = [];
+                    vector = __ecIndicator[i].vector;
+                    vector1 = __ecIndicator[(i + 1) % indLen].vector;
+                    pointList.push(this._mapVector(vector, center, scale));
+                    pointList.push(this._mapVector(vector, center, scale1));
+                    pointList.push(this._mapVector(vector1, center, scale1));
+                    pointList.push(this._mapVector(vector1, center, scale));
+                    shape = this._getShape(pointList, 'fill', color, '', 1);
+                    this.shapeList.push(shape);
+                }
+            } else if (type == 'circle') {
+                shape = this._getRing(color, scale, scale1, center);
+                this.shapeList.push(shape);
+            }
+        },
+        _mapVector: function (vector, center, scale) {
+            return [
+                vector[0] * scale + center[0],
+                vector[1] * scale + center[1]
+            ];
+        },
+        getCenter: function (index) {
+            var index = index || 0;
+            return this.parseCenter(this.zr, this.polar[index].center);
+        },
+        _addLine: function (__ecIndicator, center, axisLine) {
+            var indLen = __ecIndicator.length;
+            var line;
+            var vector;
+            var lineStyle = axisLine.lineStyle;
+            var strokeColor = lineStyle.color;
+            var lineWidth = lineStyle.width;
+            var lineType = lineStyle.type;
+            for (var i = 0; i < indLen; i++) {
+                vector = __ecIndicator[i].vector;
+                line = this._getLine(center[0], center[1], vector[0] + center[0], vector[1] + center[1], strokeColor, lineWidth, lineType);
+                this.shapeList.push(line);
+            }
+        },
+        _getLine: function (xStart, yStart, xEnd, yEnd, strokeColor, lineWidth, lineType) {
+            return new LineShape({
+                zlevel: this.getZlevelBase(),
+                z: this.getZBase(),
+                style: {
+                    xStart: xStart,
+                    yStart: yStart,
+                    xEnd: xEnd,
+                    yEnd: yEnd,
+                    strokeColor: strokeColor,
+                    lineWidth: lineWidth,
+                    lineType: lineType
+                },
+                hoverable: false
+            });
+        },
+        _adjustIndicatorValue: function (index) {
+            var item = this.polar[index];
+            var indicator = this.deepQuery(this._queryTarget, 'indicator');
+            var len = indicator.length;
+            var __ecIndicator = item.__ecIndicator;
+            var max;
+            var min;
+            var data = this._getSeriesData(index);
+            var boundaryGap = item.boundaryGap;
+            var splitNumber = item.splitNumber;
+            var scale = item.scale;
+            var opts;
+            var smartSteps = require('../util/smartSteps');
+            for (var i = 0; i < len; i++) {
+                if (typeof indicator[i].max == 'number') {
+                    max = indicator[i].max;
+                    min = indicator[i].min || 0;
+                    opts = {
+                        max: max,
+                        min: min
+                    };
+                } else {
+                    var value = this._findValue(data, i, splitNumber, boundaryGap);
+                    min = value.min;
+                    max = value.max;
+                }
+                if (!scale && min >= 0 && max >= 0) {
+                    min = 0;
+                }
+                if (!scale && min <= 0 && max <= 0) {
+                    max = 0;
+                }
+                var stepOpt = smartSteps(min, max, splitNumber, opts);
+                __ecIndicator[i].value = {
+                    min: stepOpt.min,
+                    max: stepOpt.max,
+                    step: stepOpt.step
+                };
+            }
+        },
+        _getSeriesData: function (index) {
+            var data = [];
+            var serie;
+            var serieData;
+            var legend = this.component.legend;
+            var polarIndex;
+            for (var i = 0; i < this.series.length; i++) {
+                serie = this.series[i];
+                if (serie.type != ecConfig.CHART_TYPE_RADAR) {
+                    continue;
+                }
+                serieData = serie.data || [];
+                for (var j = 0; j < serieData.length; j++) {
+                    polarIndex = this.deepQuery([
+                        serieData[j],
+                        serie,
+                        this.option
+                    ], 'polarIndex') || 0;
+                    if (polarIndex == index && (!legend || legend.isSelected(serieData[j].name))) {
+                        data.push(serieData[j]);
+                    }
+                }
+            }
+            return data;
+        },
+        _findValue: function (data, index, splitNumber, boundaryGap) {
+            var max;
+            var min;
+            var one;
+            if (!data || data.length === 0) {
+                return;
+            }
+            function _compare(item) {
+                (item > max || max === undefined) && (max = item);
+                (item < min || min === undefined) && (min = item);
+            }
+            if (data.length == 1) {
+                min = 0;
+            }
+            if (data.length != 1) {
+                for (var i = 0; i < data.length; i++) {
+                    _compare(this.getDataFromOption(data[i].value[index]));
+                }
+            } else {
+                one = data[0];
+                for (var i = 0; i < one.value.length; i++) {
+                    _compare(this.getDataFromOption(one.value[i]));
+                }
+            }
+            var gap = Math.abs(max - min);
+            min = min - Math.abs(gap * boundaryGap[0]);
+            max = max + Math.abs(gap * boundaryGap[1]);
+            if (min === max) {
+                if (max === 0) {
+                    max = 1;
+                } else if (max > 0) {
+                    min = max / splitNumber;
+                } else {
+                    max = max / splitNumber;
+                }
+            }
+            return {
+                max: max,
+                min: min
+            };
+        },
+        getVector: function (polarIndex, indicatorIndex, value) {
+            polarIndex = polarIndex || 0;
+            indicatorIndex = indicatorIndex || 0;
+            var __ecIndicator = this.polar[polarIndex].__ecIndicator;
+            if (indicatorIndex >= __ecIndicator.length) {
+                return;
+            }
+            var indicator = this.polar[polarIndex].__ecIndicator[indicatorIndex];
+            var center = this.getCenter(polarIndex);
+            var vector = indicator.vector;
+            var max = indicator.value.max;
+            var min = indicator.value.min;
+            var alpha;
+            if (typeof value == 'undefined') {
+                return center;
+            }
+            switch (value) {
+            case 'min':
+                value = min;
+                break;
+            case 'max':
+                value = max;
+                break;
+            case 'center':
+                value = (max + min) / 2;
+                break;
+            }
+            if (max != min) {
+                alpha = (value - min) / (max - min);
+            } else {
+                alpha = 0.5;
+            }
+            return this._mapVector(vector, center, alpha);
+        },
+        isInside: function (vector) {
+            var polar = this.getNearestIndex(vector);
+            if (polar) {
+                return polar.polarIndex;
+            }
+            return -1;
+        },
+        getNearestIndex: function (vector) {
+            var item;
+            var center;
+            var radius;
+            var polarVector;
+            var startAngle;
+            var indicator;
+            var len;
+            var angle;
+            var finalAngle;
+            for (var i = 0; i < this.polar.length; i++) {
+                item = this.polar[i];
+                center = this.getCenter(i);
+                if (vector[0] == center[0] && vector[1] == center[1]) {
+                    return {
+                        polarIndex: i,
+                        valueIndex: 0
+                    };
+                }
+                radius = this._getRadius();
+                startAngle = item.startAngle;
+                indicator = item.indicator;
+                len = indicator.length;
+                angle = 2 * Math.PI / len;
+                polarVector = ecCoordinates.cartesian2polar(vector[0] - center[0], center[1] - vector[1]);
+                if (vector[0] - center[0] < 0) {
+                    polarVector[1] += Math.PI;
+                }
+                if (polarVector[1] < 0) {
+                    polarVector[1] += 2 * Math.PI;
+                }
+                finalAngle = polarVector[1] - startAngle / 180 * Math.PI + Math.PI * 2;
+                if (Math.abs(Math.cos(finalAngle % (angle / 2))) * radius > polarVector[0]) {
+                    return {
+                        polarIndex: i,
+                        valueIndex: Math.floor((finalAngle + angle / 2) / angle) % len
+                    };
+                }
+            }
+        },
+        getIndicator: function (index) {
+            var index = index || 0;
+            return this.polar[index].indicator;
+        },
+        refresh: function (newOption) {
+            if (newOption) {
+                this.option = newOption;
+                this.polar = this.option.polar;
+                this.series = this.option.series;
+            }
+            this.clear();
+            this._buildShape();
+        }
+    };
+    zrUtil.inherits(Polar, Base);
+    require('../component').define('polar', Polar);
+    return Polar;
+});define('echarts/util/coordinates', [
+    'require',
+    'zrender/tool/math'
+], function (require) {
+    var zrMath = require('zrender/tool/math');
+    function polar2cartesian(r, theta) {
+        return [
+            r * zrMath.sin(theta),
+            r * zrMath.cos(theta)
+        ];
+    }
+    function cartesian2polar(x, y) {
+        return [
+            Math.sqrt(x * x + y * y),
+            Math.atan(y / x)
+        ];
+    }
+    return {
+        polar2cartesian: polar2cartesian,
+        cartesian2polar: cartesian2polar
+    };
+});

File diff suppressed because it is too large
+ 1708 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/scatter.js


+ 625 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/tree.js

@@ -0,0 +1,625 @@
+define('echarts/chart/tree', [
+    'require',
+    './base',
+    '../util/shape/Icon',
+    'zrender/shape/Image',
+    'zrender/shape/Line',
+    'zrender/shape/BezierCurve',
+    '../layout/Tree',
+    '../data/Tree',
+    '../config',
+    '../util/ecData',
+    'zrender/config',
+    'zrender/tool/event',
+    'zrender/tool/util',
+    '../chart'
+], function (require) {
+    var ChartBase = require('./base');
+    var GOLDEN_SECTION = 0.618;
+    var IconShape = require('../util/shape/Icon');
+    var ImageShape = require('zrender/shape/Image');
+    var LineShape = require('zrender/shape/Line');
+    var BezierCurveShape = require('zrender/shape/BezierCurve');
+    var TreeLayout = require('../layout/Tree');
+    var TreeData = require('../data/Tree');
+    var ecConfig = require('../config');
+    ecConfig.tree = {
+        zlevel: 1,
+        z: 2,
+        calculable: false,
+        clickable: true,
+        rootLocation: {},
+        orient: 'vertical',
+        symbol: 'circle',
+        symbolSize: 20,
+        nodePadding: 30,
+        layerPadding: 100,
+        itemStyle: {
+            normal: {
+                label: { show: true },
+                lineStyle: {
+                    width: 1,
+                    color: '#777',
+                    type: 'curve'
+                }
+            },
+            emphasis: {}
+        }
+    };
+    var ecData = require('../util/ecData');
+    var zrConfig = require('zrender/config');
+    var zrEvent = require('zrender/tool/event');
+    var zrUtil = require('zrender/tool/util');
+    function Tree(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        this.refresh(option);
+    }
+    Tree.prototype = {
+        type: ecConfig.CHART_TYPE_TREE,
+        _buildShape: function (series, seriesIndex) {
+            var data = series.data[0];
+            this.tree = TreeData.fromOptionData(data.name, data.children);
+            this.tree.root.data = data;
+            this._setTreeShape(series);
+            this.tree.traverse(function (treeNode) {
+                this._buildItem(treeNode, series, seriesIndex);
+                if (treeNode.children.length > 0) {
+                    this._buildLink(treeNode, series);
+                }
+            }, this);
+            var panable = series.roam === true || series.roam === 'move';
+            var zoomable = series.roam === true || series.roam === 'scale';
+            this.zr.modLayer(this.getZlevelBase(), {
+                panable: panable,
+                zoomable: zoomable
+            });
+            if (this.query('markPoint.effect.show') || this.query('markLine.effect.show')) {
+                this.zr.modLayer(ecConfig.EFFECT_ZLEVEL, {
+                    panable: panable,
+                    zoomable: zoomable
+                });
+            }
+            this.addShapeList();
+        },
+        _buildItem: function (treeNode, serie, seriesIndex) {
+            var queryTarget = [
+                treeNode.data,
+                serie
+            ];
+            var symbol = this.deepQuery(queryTarget, 'symbol');
+            var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {};
+            var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {};
+            var normalColor = normal.color || this.zr.getColor();
+            var emphasisColor = emphasis.color || this.zr.getColor();
+            var angle = -treeNode.layout.angle || 0;
+            if (treeNode.id === this.tree.root.id) {
+                angle = 0;
+            }
+            var textPosition = 'right';
+            if (Math.abs(angle) >= Math.PI / 2 && Math.abs(angle) < Math.PI * 3 / 2) {
+                angle += Math.PI;
+                textPosition = 'left';
+            }
+            var rotation = [
+                angle,
+                treeNode.layout.position[0],
+                treeNode.layout.position[1]
+            ];
+            var shape = new IconShape({
+                zlevel: this.getZlevelBase(),
+                z: this.getZBase() + 1,
+                rotation: rotation,
+                clickable: this.deepQuery(queryTarget, 'clickable'),
+                style: {
+                    x: treeNode.layout.position[0] - treeNode.layout.width * 0.5,
+                    y: treeNode.layout.position[1] - treeNode.layout.height * 0.5,
+                    width: treeNode.layout.width,
+                    height: treeNode.layout.height,
+                    iconType: symbol,
+                    color: normalColor,
+                    brushType: 'both',
+                    lineWidth: normal.borderWidth,
+                    strokeColor: normal.borderColor
+                },
+                highlightStyle: {
+                    color: emphasisColor,
+                    lineWidth: emphasis.borderWidth,
+                    strokeColor: emphasis.borderColor
+                }
+            });
+            if (shape.style.iconType.match('image')) {
+                shape.style.image = shape.style.iconType.replace(new RegExp('^image:\\/\\/'), '');
+                shape = new ImageShape({
+                    rotation: rotation,
+                    style: shape.style,
+                    highlightStyle: shape.highlightStyle,
+                    clickable: shape.clickable,
+                    zlevel: this.getZlevelBase(),
+                    z: this.getZBase()
+                });
+            }
+            if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) {
+                shape.style.text = treeNode.data.label == null ? treeNode.id : treeNode.data.label;
+                shape.style.textPosition = this.deepQuery(queryTarget, 'itemStyle.normal.label.position');
+                if (serie.orient === 'radial' && shape.style.textPosition !== 'inside') {
+                    shape.style.textPosition = textPosition;
+                }
+                shape.style.textColor = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle.color');
+                shape.style.textFont = this.getFont(this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle') || {});
+            }
+            if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) {
+                shape.highlightStyle.textPosition = this.deepQuery(queryTarget, 'itemStyle.emphasis.label.position');
+                shape.highlightStyle.textColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.label.textStyle.color');
+                shape.highlightStyle.textFont = this.getFont(this.deepQuery(queryTarget, 'itemStyle.emphasis.label.textStyle') || {});
+            }
+            ecData.pack(shape, serie, seriesIndex, treeNode.data, 0, treeNode.id);
+            this.shapeList.push(shape);
+        },
+        _buildLink: function (parentNode, serie) {
+            var lineStyle = serie.itemStyle.normal.lineStyle;
+            if (lineStyle.type === 'broken') {
+                this._buildBrokenLine(parentNode, lineStyle, serie);
+                return;
+            }
+            for (var i = 0; i < parentNode.children.length; i++) {
+                var xStart = parentNode.layout.position[0];
+                var yStart = parentNode.layout.position[1];
+                var xEnd = parentNode.children[i].layout.position[0];
+                var yEnd = parentNode.children[i].layout.position[1];
+                switch (lineStyle.type) {
+                case 'curve':
+                    this._buildBezierCurve(parentNode, parentNode.children[i], lineStyle, serie);
+                    break;
+                case 'broken':
+                    break;
+                default:
+                    var shape = this._getLine(xStart, yStart, xEnd, yEnd, lineStyle);
+                    this.shapeList.push(shape);
+                }
+            }
+        },
+        _buildBrokenLine: function (parentNode, lineStyle, serie) {
+            var solidLineStyle = zrUtil.clone(lineStyle);
+            solidLineStyle.type = 'solid';
+            var shapes = [];
+            var xStart = parentNode.layout.position[0];
+            var yStart = parentNode.layout.position[1];
+            var orient = serie.orient;
+            var yEnd = parentNode.children[0].layout.position[1];
+            var xMiddle = xStart;
+            var yMiddle = yStart + (yEnd - yStart) * (1 - GOLDEN_SECTION);
+            var xMiddleStart = parentNode.children[0].layout.position[0];
+            var yMiddleStart = yMiddle;
+            var xMiddleEnd = parentNode.children[parentNode.children.length - 1].layout.position[0];
+            var yMiddleEnd = yMiddle;
+            if (orient === 'horizontal') {
+                var xEnd = parentNode.children[0].layout.position[0];
+                xMiddle = xStart + (xEnd - xStart) * (1 - GOLDEN_SECTION);
+                yMiddle = yStart;
+                xMiddleStart = xMiddle;
+                yMiddleStart = parentNode.children[0].layout.position[1];
+                xMiddleEnd = xMiddle;
+                yMiddleEnd = parentNode.children[parentNode.children.length - 1].layout.position[1];
+            }
+            shapes.push(this._getLine(xStart, yStart, xMiddle, yMiddle, solidLineStyle));
+            shapes.push(this._getLine(xMiddleStart, yMiddleStart, xMiddleEnd, yMiddleEnd, solidLineStyle));
+            for (var i = 0; i < parentNode.children.length; i++) {
+                xEnd = parentNode.children[i].layout.position[0];
+                yEnd = parentNode.children[i].layout.position[1];
+                if (orient === 'horizontal') {
+                    yMiddleStart = yEnd;
+                } else {
+                    xMiddleStart = xEnd;
+                }
+                shapes.push(this._getLine(xMiddleStart, yMiddleStart, xEnd, yEnd, solidLineStyle));
+            }
+            this.shapeList = this.shapeList.concat(shapes);
+        },
+        _getLine: function (xStart, yStart, xEnd, yEnd, lineStyle) {
+            if (xStart === xEnd) {
+                xStart = xEnd = this.subPixelOptimize(xStart, lineStyle.width);
+            }
+            if (yStart === yEnd) {
+                yStart = yEnd = this.subPixelOptimize(yStart, lineStyle.width);
+            }
+            return new LineShape({
+                zlevel: this.getZlevelBase(),
+                hoverable: false,
+                style: zrUtil.merge({
+                    xStart: xStart,
+                    yStart: yStart,
+                    xEnd: xEnd,
+                    yEnd: yEnd,
+                    lineType: lineStyle.type,
+                    strokeColor: lineStyle.color,
+                    lineWidth: lineStyle.width
+                }, lineStyle, true)
+            });
+        },
+        _buildBezierCurve: function (parentNode, treeNode, lineStyle, serie) {
+            var offsetRatio = GOLDEN_SECTION;
+            var orient = serie.orient;
+            var xStart = parentNode.layout.position[0];
+            var yStart = parentNode.layout.position[1];
+            var xEnd = treeNode.layout.position[0];
+            var yEnd = treeNode.layout.position[1];
+            var cpX1 = xStart;
+            var cpY1 = (yEnd - yStart) * offsetRatio + yStart;
+            var cpX2 = xEnd;
+            var cpY2 = (yEnd - yStart) * (1 - offsetRatio) + yStart;
+            if (orient === 'horizontal') {
+                cpX1 = (xEnd - xStart) * offsetRatio + xStart;
+                cpY1 = yStart;
+                cpX2 = (xEnd - xStart) * (1 - offsetRatio) + xStart;
+                cpY2 = yEnd;
+            } else if (orient === 'radial') {
+                if (parentNode.id === this.tree.root.id) {
+                    cpX1 = (xEnd - xStart) * offsetRatio + xStart;
+                    cpY1 = (yEnd - yStart) * offsetRatio + yStart;
+                    cpX2 = (xEnd - xStart) * (1 - offsetRatio) + xStart;
+                    cpY2 = (yEnd - yStart) * (1 - offsetRatio) + yStart;
+                } else {
+                    var xStartOrigin = parentNode.layout.originPosition[0];
+                    var yStartOrigin = parentNode.layout.originPosition[1];
+                    var xEndOrigin = treeNode.layout.originPosition[0];
+                    var yEndOrigin = treeNode.layout.originPosition[1];
+                    var rootX = this.tree.root.layout.position[0];
+                    var rootY = this.tree.root.layout.position[1];
+                    cpX1 = xStartOrigin;
+                    cpY1 = (yEndOrigin - yStartOrigin) * offsetRatio + yStartOrigin;
+                    cpX2 = xEndOrigin;
+                    cpY2 = (yEndOrigin - yStartOrigin) * (1 - offsetRatio) + yStartOrigin;
+                    var rad = (cpX1 - this.minX) / this.width * Math.PI * 2;
+                    cpX1 = cpY1 * Math.cos(rad) + rootX;
+                    cpY1 = cpY1 * Math.sin(rad) + rootY;
+                    rad = (cpX2 - this.minX) / this.width * Math.PI * 2;
+                    cpX2 = cpY2 * Math.cos(rad) + rootX;
+                    cpY2 = cpY2 * Math.sin(rad) + rootY;
+                }
+            }
+            var shape = new BezierCurveShape({
+                zlevel: this.getZlevelBase(),
+                hoverable: false,
+                style: zrUtil.merge({
+                    xStart: xStart,
+                    yStart: yStart,
+                    cpX1: cpX1,
+                    cpY1: cpY1,
+                    cpX2: cpX2,
+                    cpY2: cpY2,
+                    xEnd: xEnd,
+                    yEnd: yEnd,
+                    strokeColor: lineStyle.color,
+                    lineWidth: lineStyle.width
+                }, lineStyle, true)
+            });
+            this.shapeList.push(shape);
+        },
+        _setTreeShape: function (serie) {
+            var treeLayout = new TreeLayout({
+                nodePadding: serie.nodePadding,
+                layerPadding: serie.layerPadding
+            });
+            this.tree.traverse(function (treeNode) {
+                var queryTarget = [
+                    treeNode.data,
+                    serie
+                ];
+                var symbolSize = this.deepQuery(queryTarget, 'symbolSize');
+                if (typeof symbolSize === 'number') {
+                    symbolSize = [
+                        symbolSize,
+                        symbolSize
+                    ];
+                }
+                treeNode.layout = {
+                    width: symbolSize[0],
+                    height: symbolSize[1]
+                };
+            }, this);
+            treeLayout.run(this.tree);
+            var orient = serie.orient;
+            var rootX = serie.rootLocation.x;
+            var rootY = serie.rootLocation.y;
+            var zrWidth = this.zr.getWidth();
+            var zrHeight = this.zr.getHeight();
+            if (rootX === 'center') {
+                rootX = zrWidth * 0.5;
+            } else {
+                rootX = this.parsePercent(rootX, zrWidth);
+            }
+            if (rootY === 'center') {
+                rootY = zrHeight * 0.5;
+            } else {
+                rootY = this.parsePercent(rootY, zrHeight);
+            }
+            rootY = this.parsePercent(rootY, zrHeight);
+            if (orient === 'horizontal') {
+                rootX = isNaN(rootX) ? 10 : rootX;
+                rootY = isNaN(rootY) ? zrHeight * 0.5 : rootY;
+            }
+            if (orient === 'radial') {
+                rootX = isNaN(rootX) ? zrWidth * 0.5 : rootX;
+                rootY = isNaN(rootY) ? zrHeight * 0.5 : rootY;
+            } else {
+                rootX = isNaN(rootX) ? zrWidth * 0.5 : rootX;
+                rootY = isNaN(rootY) ? 10 : rootY;
+            }
+            var originRootX = this.tree.root.layout.position[0];
+            if (orient === 'radial') {
+                var minX = Infinity;
+                var maxX = 0;
+                var maxWidth = 0;
+                this.tree.traverse(function (treeNode) {
+                    maxX = Math.max(maxX, treeNode.layout.position[0]);
+                    minX = Math.min(minX, treeNode.layout.position[0]);
+                    maxWidth = Math.max(maxWidth, treeNode.layout.width);
+                });
+                this.width = maxX - minX + 2 * maxWidth;
+                this.minX = minX;
+            }
+            this.tree.traverse(function (treeNode) {
+                var x;
+                var y;
+                if (orient === 'vertical' && serie.direction === 'inverse') {
+                    x = treeNode.layout.position[0] - originRootX + rootX;
+                    y = rootY - treeNode.layout.position[1];
+                } else if (orient === 'vertical') {
+                    x = treeNode.layout.position[0] - originRootX + rootX;
+                    y = treeNode.layout.position[1] + rootY;
+                } else if (orient === 'horizontal' && serie.direction === 'inverse') {
+                    y = treeNode.layout.position[0] - originRootX + rootY;
+                    x = rootX - treeNode.layout.position[1];
+                } else if (orient === 'horizontal') {
+                    y = treeNode.layout.position[0] - originRootX + rootY;
+                    x = treeNode.layout.position[1] + rootX;
+                } else {
+                    x = treeNode.layout.position[0];
+                    y = treeNode.layout.position[1];
+                    treeNode.layout.originPosition = [
+                        x,
+                        y
+                    ];
+                    var r = y;
+                    var angle = (x - minX) / this.width * Math.PI * 2;
+                    x = r * Math.cos(angle) + rootX;
+                    y = r * Math.sin(angle) + rootY;
+                    treeNode.layout.angle = angle;
+                }
+                treeNode.layout.position[0] = x;
+                treeNode.layout.position[1] = y;
+            }, this);
+        },
+        refresh: function (newOption) {
+            this.clear();
+            if (newOption) {
+                this.option = newOption;
+                this.series = this.option.series;
+            }
+            var series = this.series;
+            var legend = this.component.legend;
+            for (var i = 0; i < series.length; i++) {
+                if (series[i].type === ecConfig.CHART_TYPE_TREE) {
+                    series[i] = this.reformOption(series[i]);
+                    var seriesName = series[i].name || '';
+                    this.selectedMap[seriesName] = legend ? legend.isSelected(seriesName) : true;
+                    if (!this.selectedMap[seriesName]) {
+                        continue;
+                    }
+                    this._buildSeries(series[i], i);
+                }
+            }
+        },
+        _buildSeries: function (series, seriesIndex) {
+            this._buildShape(series, seriesIndex);
+        }
+    };
+    zrUtil.inherits(Tree, ChartBase);
+    require('../chart').define('tree', Tree);
+    return Tree;
+});define('echarts/layout/Tree', [
+    'require',
+    'zrender/tool/vector'
+], function (require) {
+    var vec2 = require('zrender/tool/vector');
+    function TreeLayout(opts) {
+        opts = opts || {};
+        this.nodePadding = opts.nodePadding || 30;
+        this.layerPadding = opts.layerPadding || 100;
+        this._layerOffsets = [];
+        this._layers = [];
+    }
+    TreeLayout.prototype.run = function (tree) {
+        this._layerOffsets.length = 0;
+        for (var i = 0; i < tree.root.height + 1; i++) {
+            this._layerOffsets[i] = 0;
+            this._layers[i] = [];
+        }
+        this._updateNodeXPosition(tree.root);
+        var root = tree.root;
+        this._updateNodeYPosition(root, 0, root.layout.height);
+    };
+    TreeLayout.prototype._updateNodeXPosition = function (node) {
+        var minX = Infinity;
+        var maxX = -Infinity;
+        node.layout.position = node.layout.position || vec2.create();
+        for (var i = 0; i < node.children.length; i++) {
+            var child = node.children[i];
+            this._updateNodeXPosition(child);
+            var x = child.layout.position[0];
+            if (x < minX) {
+                minX = x;
+            }
+            if (x > maxX) {
+                maxX = x;
+            }
+        }
+        if (node.children.length > 0) {
+            node.layout.position[0] = (minX + maxX) / 2;
+        } else {
+            node.layout.position[0] = 0;
+        }
+        var off = this._layerOffsets[node.depth] || 0;
+        if (off > node.layout.position[0]) {
+            var shift = off - node.layout.position[0];
+            this._shiftSubtree(node, shift);
+            for (var i = node.depth + 1; i < node.height + node.depth; i++) {
+                this._layerOffsets[i] += shift;
+            }
+        }
+        this._layerOffsets[node.depth] = node.layout.position[0] + node.layout.width + this.nodePadding;
+        this._layers[node.depth].push(node);
+    };
+    TreeLayout.prototype._shiftSubtree = function (root, offset) {
+        root.layout.position[0] += offset;
+        for (var i = 0; i < root.children.length; i++) {
+            this._shiftSubtree(root.children[i], offset);
+        }
+    };
+    TreeLayout.prototype._updateNodeYPosition = function (node, y, prevLayerHeight) {
+        node.layout.position[1] = y;
+        var layerHeight = 0;
+        for (var i = 0; i < node.children.length; i++) {
+            layerHeight = Math.max(node.children[i].layout.height, layerHeight);
+        }
+        var layerPadding = this.layerPadding;
+        if (typeof layerPadding === 'function') {
+            layerPadding = layerPadding(node.depth);
+        }
+        for (var i = 0; i < node.children.length; i++) {
+            this._updateNodeYPosition(node.children[i], y + layerPadding + prevLayerHeight, layerHeight);
+        }
+    };
+    return TreeLayout;
+});define('echarts/data/Tree', [
+    'require',
+    'zrender/tool/util'
+], function (require) {
+    var zrUtil = require('zrender/tool/util');
+    function TreeNode(id, data) {
+        this.id = id;
+        this.depth = 0;
+        this.height = 0;
+        this.children = [];
+        this.parent = null;
+        this.data = data || null;
+    }
+    TreeNode.prototype.add = function (child) {
+        var children = this.children;
+        if (child.parent === this) {
+            return;
+        }
+        children.push(child);
+        child.parent = this;
+    };
+    TreeNode.prototype.remove = function (child) {
+        var children = this.children;
+        var idx = zrUtil.indexOf(children, child);
+        if (idx >= 0) {
+            children.splice(idx, 1);
+            child.parent = null;
+        }
+    };
+    TreeNode.prototype.traverse = function (cb, context) {
+        cb.call(context, this);
+        for (var i = 0; i < this.children.length; i++) {
+            this.children[i].traverse(cb, context);
+        }
+    };
+    TreeNode.prototype.updateDepthAndHeight = function (depth) {
+        var height = 0;
+        this.depth = depth;
+        for (var i = 0; i < this.children.length; i++) {
+            var child = this.children[i];
+            child.updateDepthAndHeight(depth + 1);
+            if (child.height > height) {
+                height = child.height;
+            }
+        }
+        this.height = height + 1;
+    };
+    TreeNode.prototype.getNodeById = function (id) {
+        if (this.id === id) {
+            return this;
+        }
+        for (var i = 0; i < this.children.length; i++) {
+            var res = this.children[i].getNodeById(id);
+            if (res) {
+                return res;
+            }
+        }
+    };
+    function Tree(id) {
+        this.root = new TreeNode(id);
+    }
+    Tree.prototype.traverse = function (cb, context) {
+        this.root.traverse(cb, context);
+    };
+    Tree.prototype.getSubTree = function (id) {
+        var root = this.getNodeById(id);
+        if (root) {
+            var tree = new Tree(root.id);
+            tree.root = root;
+            return tree;
+        }
+    };
+    Tree.prototype.getNodeById = function (id) {
+        return this.root.getNodeById(id);
+    };
+    Tree.fromOptionData = function (id, data) {
+        var tree = new Tree(id);
+        var rootNode = tree.root;
+        rootNode.data = {
+            name: id,
+            children: data
+        };
+        function buildHierarchy(dataNode, parentNode) {
+            var node = new TreeNode(dataNode.name, dataNode);
+            parentNode.add(node);
+            var children = dataNode.children;
+            if (children) {
+                for (var i = 0; i < children.length; i++) {
+                    buildHierarchy(children[i], node);
+                }
+            }
+        }
+        for (var i = 0; i < data.length; i++) {
+            buildHierarchy(data[i], rootNode);
+        }
+        tree.root.updateDepthAndHeight(0);
+        return tree;
+    };
+    Tree.fromGraph = function (graph) {
+        function buildHierarchy(root) {
+            var graphNode = graph.getNodeById(root.id);
+            for (var i = 0; i < graphNode.outEdges.length; i++) {
+                var edge = graphNode.outEdges[i];
+                var childTreeNode = treeNodesMap[edge.node2.id];
+                root.children.push(childTreeNode);
+                buildHierarchy(childTreeNode);
+            }
+        }
+        var treeMap = {};
+        var treeNodesMap = {};
+        for (var i = 0; i < graph.nodes.length; i++) {
+            var node = graph.nodes[i];
+            var treeNode;
+            if (node.inDegree() === 0) {
+                treeMap[node.id] = new Tree(node.id);
+                treeNode = treeMap[node.id].root;
+            } else {
+                treeNode = new TreeNode(node.id);
+            }
+            treeNode.data = node.data;
+            treeNodesMap[node.id] = treeNode;
+        }
+        var treeList = [];
+        for (var id in treeMap) {
+            buildHierarchy(treeMap[id].root);
+            treeMap[id].root.updateDepthAndHeight(0);
+            treeList.push(treeMap[id]);
+        }
+        return treeList;
+    };
+    return Tree;
+});

+ 632 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/treemap.js

@@ -0,0 +1,632 @@
+define('echarts/chart/treemap', [
+    'require',
+    './base',
+    'zrender/tool/area',
+    'zrender/shape/Rectangle',
+    'zrender/shape/Text',
+    'zrender/shape/Line',
+    '../layout/TreeMap',
+    '../data/Tree',
+    '../config',
+    '../util/ecData',
+    'zrender/config',
+    'zrender/tool/event',
+    'zrender/tool/util',
+    'zrender/tool/color',
+    '../chart'
+], function (require) {
+    var ChartBase = require('./base');
+    var toolArea = require('zrender/tool/area');
+    var RectangleShape = require('zrender/shape/Rectangle');
+    var TextShape = require('zrender/shape/Text');
+    var LineShape = require('zrender/shape/Line');
+    var TreeMapLayout = require('../layout/TreeMap');
+    var Tree = require('../data/Tree');
+    var ecConfig = require('../config');
+    ecConfig.treemap = {
+        zlevel: 0,
+        z: 1,
+        calculable: false,
+        clickable: true,
+        center: [
+            '50%',
+            '50%'
+        ],
+        size: [
+            '80%',
+            '80%'
+        ],
+        root: '',
+        itemStyle: {
+            normal: {
+                label: {
+                    show: true,
+                    x: 5,
+                    y: 12,
+                    textStyle: {
+                        align: 'left',
+                        color: '#000',
+                        fontFamily: 'Arial',
+                        fontSize: 13,
+                        fontStyle: 'normal',
+                        fontWeight: 'normal'
+                    }
+                },
+                breadcrumb: {
+                    show: true,
+                    textStyle: {}
+                },
+                borderWidth: 1,
+                borderColor: '#ccc',
+                childBorderWidth: 1,
+                childBorderColor: '#ccc'
+            },
+            emphasis: {}
+        }
+    };
+    var ecData = require('../util/ecData');
+    var zrConfig = require('zrender/config');
+    var zrEvent = require('zrender/tool/event');
+    var zrUtil = require('zrender/tool/util');
+    var zrColor = require('zrender/tool/color');
+    function Treemap(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        this.refresh(option);
+        var self = this;
+        self._onclick = function (params) {
+            return self.__onclick(params);
+        };
+        self.zr.on(zrConfig.EVENT.CLICK, self._onclick);
+    }
+    Treemap.prototype = {
+        type: ecConfig.CHART_TYPE_TREEMAP,
+        refresh: function (newOption) {
+            this.clear();
+            if (newOption) {
+                this.option = newOption;
+                this.series = this.option.series;
+            }
+            this._treesMap = {};
+            var series = this.series;
+            var legend = this.component.legend;
+            for (var i = 0; i < series.length; i++) {
+                if (series[i].type === ecConfig.CHART_TYPE_TREEMAP) {
+                    series[i] = this.reformOption(series[i]);
+                    var seriesName = series[i].name || '';
+                    this.selectedMap[seriesName] = legend ? legend.isSelected(seriesName) : true;
+                    if (!this.selectedMap[seriesName]) {
+                        continue;
+                    }
+                    this._buildSeries(series[i], i);
+                }
+            }
+        },
+        _buildSeries: function (series, seriesIndex) {
+            var tree = Tree.fromOptionData(series.name, series.data);
+            this._treesMap[seriesIndex] = tree;
+            var treeRoot = series.root && tree.getNodeById(series.root) || tree.root;
+            this._buildTreemap(treeRoot, seriesIndex);
+        },
+        _buildTreemap: function (treeRoot, seriesIndex) {
+            var shapeList = this.shapeList;
+            for (var i = 0; i < shapeList.length;) {
+                var shape = shapeList[i];
+                if (ecData.get(shape, 'seriesIndex') === seriesIndex) {
+                    this.zr.delShape(shapeList[i]);
+                    shapeList.splice(i, 1);
+                } else {
+                    i++;
+                }
+            }
+            var currentShapeLen = shapeList.length;
+            var series = this.series[seriesIndex];
+            var itemStyle = series.itemStyle;
+            var treemapWidth = this.parsePercent(series.size[0], this.zr.getWidth()) || 400;
+            var treemapHeight = this.parsePercent(series.size[1], this.zr.getHeight()) || 500;
+            var center = this.parseCenter(this.zr, series.center);
+            var treemapX = center[0] - treemapWidth * 0.5;
+            var treemapY = center[1] - treemapHeight * 0.5;
+            var treemapArea = treemapWidth * treemapHeight;
+            var sum = 0;
+            var areaArr = [];
+            var children = treeRoot.children;
+            for (var i = 0; i < children.length; i++) {
+                sum += children[i].data.value;
+            }
+            for (var j = 0; j < children.length; j++) {
+                areaArr.push(children[j].data.value * treemapArea / sum);
+            }
+            var treeMapLayout = new TreeMapLayout({
+                x: treemapX,
+                y: treemapY,
+                width: treemapWidth,
+                height: treemapHeight
+            });
+            var locationArr = treeMapLayout.run(areaArr);
+            for (var k = 0; k < locationArr.length; k++) {
+                var dataItem = children[k].data;
+                var rect = locationArr[k];
+                var queryTarget = [
+                    dataItem.itemStyle,
+                    itemStyle
+                ];
+                var itemStyleMerged = this.deepMerge(queryTarget);
+                if (!itemStyleMerged.normal.color) {
+                    itemStyleMerged.normal.color = this.zr.getColor(k);
+                }
+                if (!itemStyleMerged.emphasis.color) {
+                    itemStyleMerged.emphasis.color = itemStyleMerged.normal.color;
+                }
+                this._buildItem(dataItem, itemStyleMerged, rect, seriesIndex, k);
+                if (dataItem.children) {
+                    this._buildChildrenTreemap(dataItem.children, itemStyleMerged, rect, seriesIndex);
+                }
+            }
+            if (this.query(series, 'itemStyle.normal.breadcrumb.show')) {
+                this._buildBreadcrumb(treeRoot, seriesIndex, treemapX, treemapY + treemapHeight);
+            }
+            for (var i = currentShapeLen; i < shapeList.length; i++) {
+                this.zr.addShape(shapeList[i]);
+            }
+        },
+        _buildItem: function (dataItem, itemStyle, rect, seriesIndex, dataIndex) {
+            var series = this.series;
+            var rectangle = this.getRectangle(dataItem, itemStyle, rect);
+            ecData.pack(rectangle, series[seriesIndex], seriesIndex, dataItem, dataIndex, dataItem.name);
+            this.shapeList.push(rectangle);
+        },
+        getRectangle: function (dataItem, itemStyle, rect) {
+            var emphasis = itemStyle.emphasis;
+            var normal = itemStyle.normal;
+            var textShape = this.getLabel(itemStyle, rect, dataItem.name, dataItem.value);
+            var hoverable = this.option.hoverable;
+            var rectangleShape = {
+                zlevel: this.getZlevelBase(),
+                z: this.getZBase(),
+                hoverable: hoverable,
+                clickable: true,
+                style: zrUtil.merge({
+                    x: rect.x,
+                    y: rect.y,
+                    width: rect.width,
+                    height: rect.height,
+                    brushType: 'both',
+                    color: normal.color,
+                    lineWidth: normal.borderWidth,
+                    strokeColor: normal.borderColor
+                }, textShape.style, true),
+                highlightStyle: zrUtil.merge({
+                    color: emphasis.color,
+                    lineWidth: emphasis.borderWidth,
+                    strokeColor: emphasis.borderColor
+                }, textShape.highlightStyle, true)
+            };
+            return new RectangleShape(rectangleShape);
+        },
+        getLabel: function (itemStyle, rect, name, value) {
+            var normalTextStyle = itemStyle.normal.label.textStyle;
+            var queryTarget = [
+                itemStyle.emphasis.label.textStyle,
+                normalTextStyle
+            ];
+            var emphasisTextStyle = this.deepMerge(queryTarget);
+            var formatter = itemStyle.normal.label.formatter;
+            var text = this.getLabelText(name, value, formatter);
+            var textFont = this.getFont(normalTextStyle);
+            var textWidth = toolArea.getTextWidth(text, textFont);
+            var textHeight = toolArea.getTextHeight(text, textFont);
+            var emphasisFormatter = this.deepQuery([
+                itemStyle.emphasis,
+                itemStyle.normal
+            ], 'label.formatter');
+            var emphasisText = this.getLabelText(name, value, emphasisFormatter);
+            var emphasisTextFont = this.getFont(emphasisTextStyle);
+            var emphasisTextWidth = toolArea.getTextWidth(text, emphasisTextFont);
+            var emphasisTextHeight = toolArea.getTextHeight(text, emphasisTextFont);
+            if (!itemStyle.normal.label.show) {
+                text = '';
+            } else if (itemStyle.normal.label.x + textWidth > rect.width || itemStyle.normal.label.y + textHeight > rect.height) {
+                text = '';
+            }
+            if (!itemStyle.emphasis.label.show) {
+                emphasisText = '';
+            } else if (emphasisTextStyle.x + emphasisTextWidth > rect.width || emphasisTextStyle.y + emphasisTextHeight > rect.height) {
+                emphasisText = '';
+            }
+            var textShape = {
+                style: {
+                    textX: rect.x + itemStyle.normal.label.x,
+                    textY: rect.y + itemStyle.normal.label.y,
+                    text: text,
+                    textPosition: 'specific',
+                    textColor: normalTextStyle.color,
+                    textFont: textFont
+                },
+                highlightStyle: {
+                    textX: rect.x + itemStyle.emphasis.label.x,
+                    textY: rect.y + itemStyle.emphasis.label.y,
+                    text: emphasisText,
+                    textColor: emphasisTextStyle.color,
+                    textPosition: 'specific'
+                }
+            };
+            return textShape;
+        },
+        getLabelText: function (name, value, formatter) {
+            if (formatter) {
+                if (typeof formatter === 'function') {
+                    return formatter.call(this.myChart, name, value);
+                } else if (typeof formatter === 'string') {
+                    formatter = formatter.replace('{b}', '{b0}').replace('{c}', '{c0}');
+                    formatter = formatter.replace('{b0}', name).replace('{c0}', value);
+                    return formatter;
+                }
+            } else {
+                return name;
+            }
+        },
+        _buildChildrenTreemap: function (data, itemStyle, rect, seriesIndex) {
+            var treemapArea = rect.width * rect.height;
+            var sum = 0;
+            var areaArr = [];
+            for (var i = 0; i < data.length; i++) {
+                sum += data[i].value;
+            }
+            for (var j = 0; j < data.length; j++) {
+                areaArr.push(data[j].value * treemapArea / sum);
+            }
+            var treeMapLayout = new TreeMapLayout({
+                x: rect.x,
+                y: rect.y,
+                width: rect.width,
+                height: rect.height
+            });
+            var locationArr = treeMapLayout.run(areaArr);
+            var lineWidth = itemStyle.normal.childBorderWidth;
+            var lineColor = itemStyle.normal.childBorderColor;
+            for (var k = 0; k < locationArr.length; k++) {
+                var item = locationArr[k];
+                var lines = [];
+                if (rect.y.toFixed(2) !== item.y.toFixed(2)) {
+                    lines.push(this._getLine(item.x, item.y, item.x + item.width, item.y, lineWidth, lineColor));
+                }
+                if (rect.x.toFixed(2) !== item.x.toFixed(2)) {
+                    lines.push(this._getLine(item.x, item.y, item.x, item.y + item.height, lineWidth, lineColor));
+                }
+                if ((rect.y + rect.height).toFixed(2) !== (item.y + item.height).toFixed(2)) {
+                    lines.push(this._getLine(item.x, item.y + item.height, item.x + item.width, item.y + item.height, lineWidth, lineColor));
+                }
+                if ((rect.x + rect.width).toFixed(2) !== (item.x + item.width).toFixed(2)) {
+                    lines.push(this._getLine(item.x + item.width, item.y, item.x + item.width, item.y + item.height, lineWidth, lineColor));
+                }
+                for (var l = 0; l < lines.length; l++) {
+                    ecData.set(lines[l], 'seriesIndex', seriesIndex);
+                    this.shapeList.push(lines[l]);
+                }
+            }
+        },
+        _getLine: function (xStart, yStart, xEnd, yEnd, lineWidth, lineColor) {
+            var lineShape = {
+                zlevel: this.getZlevelBase(),
+                z: this.getZBase(),
+                hoverable: false,
+                style: {
+                    xStart: xStart,
+                    yStart: yStart,
+                    xEnd: xEnd,
+                    yEnd: yEnd,
+                    lineWidth: lineWidth,
+                    strokeColor: lineColor
+                }
+            };
+            return new LineShape(lineShape);
+        },
+        _buildBreadcrumb: function (treeRoot, seriesIndex, x, y) {
+            var stack = [];
+            var current = treeRoot;
+            while (current) {
+                stack.unshift(current.data.name);
+                current = current.parent;
+            }
+            var series = this.series[seriesIndex];
+            var textStyle = this.query(series, 'itemStyle.normal.breadcrumb.textStyle') || {};
+            var textEmphasisStyle = this.query(series, 'itemStyle.emphasis.breadcrumb.textStyle') || {};
+            var commonStyle = {
+                y: y + 10,
+                textBaseline: 'top',
+                textAlign: 'left',
+                color: textStyle.color,
+                textFont: this.getFont(textStyle)
+            };
+            var commonHighlightStyle = {
+                brushType: 'fill',
+                color: textEmphasisStyle.color || zrColor.lift(textStyle.color, -0.3),
+                textFont: this.getFont(textEmphasisStyle)
+            };
+            for (var i = 0; i < stack.length; i++) {
+                var textShape = new TextShape({
+                    zlevel: this.getZlevelBase(),
+                    z: this.getZBase(),
+                    style: zrUtil.merge({
+                        x: x,
+                        text: stack[i] + (stack.length - 1 - i ? ' > ' : '')
+                    }, commonStyle),
+                    clickable: true,
+                    highlightStyle: commonHighlightStyle
+                });
+                ecData.set(textShape, 'seriesIndex', seriesIndex);
+                ecData.set(textShape, 'name', stack[i]);
+                x += textShape.getRect(textShape.style).width;
+                this.shapeList.push(textShape);
+            }
+        },
+        __onclick: function (params) {
+            var target = params.target;
+            if (target) {
+                var seriesIndex = ecData.get(target, 'seriesIndex');
+                var name = ecData.get(target, 'name');
+                var tree = this._treesMap[seriesIndex];
+                var root = tree.getNodeById(name);
+                if (root && root.children.length) {
+                    this._buildTreemap(root, seriesIndex);
+                }
+            }
+        }
+    };
+    zrUtil.inherits(Treemap, ChartBase);
+    require('../chart').define('treemap', Treemap);
+    return Treemap;
+});define('echarts/layout/TreeMap', ['require'], function (require) {
+    function TreeMapLayout(opts) {
+        var row = {
+            x: opts.x,
+            y: opts.y,
+            width: opts.width,
+            height: opts.height
+        };
+        this.x = opts.x;
+        this.y = opts.y;
+        this.width = opts.width;
+        this.height = opts.height;
+    }
+    TreeMapLayout.prototype.run = function (areas) {
+        var out = [];
+        this._squarify(areas, {
+            x: this.x,
+            y: this.y,
+            width: this.width,
+            height: this.height
+        }, out);
+        return out;
+    };
+    TreeMapLayout.prototype._squarify = function (areas, row, out) {
+        var layoutDirection = 'VERTICAL';
+        var width = row.width;
+        var height = row.height;
+        if (row.width < row.height) {
+            layoutDirection = 'HORIZONTAL';
+            width = row.height;
+            height = row.width;
+        }
+        var shapeArr = this._getShapeListInAbstractRow(areas, width, height);
+        for (var i = 0; i < shapeArr.length; i++) {
+            shapeArr[i].x = 0;
+            shapeArr[i].y = 0;
+            for (var j = 0; j < i; j++) {
+                shapeArr[i].y += shapeArr[j].height;
+            }
+        }
+        var nextRow = {};
+        if (layoutDirection == 'VERTICAL') {
+            for (var k = 0; k < shapeArr.length; k++) {
+                out.push({
+                    x: shapeArr[k].x + row.x,
+                    y: shapeArr[k].y + row.y,
+                    width: shapeArr[k].width,
+                    height: shapeArr[k].height
+                });
+            }
+            nextRow = {
+                x: shapeArr[0].width + row.x,
+                y: row.y,
+                width: row.width - shapeArr[0].width,
+                height: row.height
+            };
+        } else {
+            for (var l = 0; l < shapeArr.length; l++) {
+                out.push({
+                    x: shapeArr[l].y + row.x,
+                    y: shapeArr[l].x + row.y,
+                    width: shapeArr[l].height,
+                    height: shapeArr[l].width
+                });
+            }
+            nextRow = {
+                x: row.x,
+                y: row.y + shapeArr[0].width,
+                width: row.width,
+                height: row.height - shapeArr[0].width
+            };
+        }
+        var nextAreaArr = areas.slice(shapeArr.length);
+        if (nextAreaArr.length === 0) {
+            return;
+        } else {
+            this._squarify(nextAreaArr, nextRow, out);
+        }
+    };
+    TreeMapLayout.prototype._getShapeListInAbstractRow = function (areas, width, height) {
+        if (areas.length === 1) {
+            return [{
+                    width: width,
+                    height: height
+                }];
+        }
+        for (var count = 1; count < areas.length; count++) {
+            var shapeArr0 = this._placeFixedNumberRectangles(areas.slice(0, count), width, height);
+            var shapeArr1 = this._placeFixedNumberRectangles(areas.slice(0, count + 1), width, height);
+            if (this._isFirstBetter(shapeArr0, shapeArr1)) {
+                return shapeArr0;
+            }
+        }
+    };
+    TreeMapLayout.prototype._placeFixedNumberRectangles = function (areaSubArr, width, height) {
+        var count = areaSubArr.length;
+        var shapeArr = [];
+        var sum = 0;
+        for (var i = 0; i < areaSubArr.length; i++) {
+            sum += areaSubArr[i];
+        }
+        var cellWidth = sum / height;
+        for (var j = 0; j < count; j++) {
+            var cellHeight = height * areaSubArr[j] / sum;
+            shapeArr.push({
+                width: cellWidth,
+                height: cellHeight
+            });
+        }
+        return shapeArr;
+    };
+    TreeMapLayout.prototype._isFirstBetter = function (shapeArr0, shapeArr1) {
+        var ratio0 = shapeArr0[0].height / shapeArr0[0].width;
+        ratio0 = ratio0 > 1 ? 1 / ratio0 : ratio0;
+        var ratio1 = shapeArr1[0].height / shapeArr1[0].width;
+        ratio1 = ratio1 > 1 ? 1 / ratio1 : ratio1;
+        if (Math.abs(ratio0 - 1) <= Math.abs(ratio1 - 1)) {
+            return true;
+        }
+        return false;
+    };
+    return TreeMapLayout;
+});define('echarts/data/Tree', [
+    'require',
+    'zrender/tool/util'
+], function (require) {
+    var zrUtil = require('zrender/tool/util');
+    function TreeNode(id, data) {
+        this.id = id;
+        this.depth = 0;
+        this.height = 0;
+        this.children = [];
+        this.parent = null;
+        this.data = data || null;
+    }
+    TreeNode.prototype.add = function (child) {
+        var children = this.children;
+        if (child.parent === this) {
+            return;
+        }
+        children.push(child);
+        child.parent = this;
+    };
+    TreeNode.prototype.remove = function (child) {
+        var children = this.children;
+        var idx = zrUtil.indexOf(children, child);
+        if (idx >= 0) {
+            children.splice(idx, 1);
+            child.parent = null;
+        }
+    };
+    TreeNode.prototype.traverse = function (cb, context) {
+        cb.call(context, this);
+        for (var i = 0; i < this.children.length; i++) {
+            this.children[i].traverse(cb, context);
+        }
+    };
+    TreeNode.prototype.updateDepthAndHeight = function (depth) {
+        var height = 0;
+        this.depth = depth;
+        for (var i = 0; i < this.children.length; i++) {
+            var child = this.children[i];
+            child.updateDepthAndHeight(depth + 1);
+            if (child.height > height) {
+                height = child.height;
+            }
+        }
+        this.height = height + 1;
+    };
+    TreeNode.prototype.getNodeById = function (id) {
+        if (this.id === id) {
+            return this;
+        }
+        for (var i = 0; i < this.children.length; i++) {
+            var res = this.children[i].getNodeById(id);
+            if (res) {
+                return res;
+            }
+        }
+    };
+    function Tree(id) {
+        this.root = new TreeNode(id);
+    }
+    Tree.prototype.traverse = function (cb, context) {
+        this.root.traverse(cb, context);
+    };
+    Tree.prototype.getSubTree = function (id) {
+        var root = this.getNodeById(id);
+        if (root) {
+            var tree = new Tree(root.id);
+            tree.root = root;
+            return tree;
+        }
+    };
+    Tree.prototype.getNodeById = function (id) {
+        return this.root.getNodeById(id);
+    };
+    Tree.fromOptionData = function (id, data) {
+        var tree = new Tree(id);
+        var rootNode = tree.root;
+        rootNode.data = {
+            name: id,
+            children: data
+        };
+        function buildHierarchy(dataNode, parentNode) {
+            var node = new TreeNode(dataNode.name, dataNode);
+            parentNode.add(node);
+            var children = dataNode.children;
+            if (children) {
+                for (var i = 0; i < children.length; i++) {
+                    buildHierarchy(children[i], node);
+                }
+            }
+        }
+        for (var i = 0; i < data.length; i++) {
+            buildHierarchy(data[i], rootNode);
+        }
+        tree.root.updateDepthAndHeight(0);
+        return tree;
+    };
+    Tree.fromGraph = function (graph) {
+        function buildHierarchy(root) {
+            var graphNode = graph.getNodeById(root.id);
+            for (var i = 0; i < graphNode.outEdges.length; i++) {
+                var edge = graphNode.outEdges[i];
+                var childTreeNode = treeNodesMap[edge.node2.id];
+                root.children.push(childTreeNode);
+                buildHierarchy(childTreeNode);
+            }
+        }
+        var treeMap = {};
+        var treeNodesMap = {};
+        for (var i = 0; i < graph.nodes.length; i++) {
+            var node = graph.nodes[i];
+            var treeNode;
+            if (node.inDegree() === 0) {
+                treeMap[node.id] = new Tree(node.id);
+                treeNode = treeMap[node.id].root;
+            } else {
+                treeNode = new TreeNode(node.id);
+            }
+            treeNode.data = node.data;
+            treeNodesMap[node.id] = treeNode;
+        }
+        var treeList = [];
+        for (var id in treeMap) {
+            buildHierarchy(treeMap[id].root);
+            treeMap[id].root.updateDepthAndHeight(0);
+            treeList.push(treeMap[id]);
+        }
+        return treeList;
+    };
+    return Tree;
+});

+ 686 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/venn.js

@@ -0,0 +1,686 @@
+define('echarts/chart/venn', [
+    'require',
+    './base',
+    'zrender/shape/Text',
+    'zrender/shape/Circle',
+    'zrender/shape/Path',
+    '../config',
+    '../util/ecData',
+    'zrender/tool/util',
+    '../chart'
+], function (require) {
+    var ChartBase = require('./base');
+    var TextShape = require('zrender/shape/Text');
+    var CircleShape = require('zrender/shape/Circle');
+    var PathShape = require('zrender/shape/Path');
+    var ecConfig = require('../config');
+    ecConfig.venn = {
+        zlevel: 0,
+        z: 1,
+        calculable: false
+    };
+    var ecData = require('../util/ecData');
+    var zrUtil = require('zrender/tool/util');
+    function Venn(ecTheme, messageCenter, zr, option, myChart) {
+        ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
+        this.refresh(option);
+    }
+    Venn.prototype = {
+        type: ecConfig.CHART_TYPE_VENN,
+        _buildShape: function () {
+            this.selectedMap = {};
+            this._symbol = this.option.symbolList;
+            this._queryTarget;
+            this._dropBoxList = [];
+            this._vennDataCounter = 0;
+            var series = this.series;
+            var legend = this.component.legend;
+            for (var i = 0; i < series.length; i++) {
+                if (series[i].type === ecConfig.CHART_TYPE_VENN) {
+                    series[i] = this.reformOption(series[i]);
+                    var serieName = series[i].name || '';
+                    this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true;
+                    if (!this.selectedMap[serieName]) {
+                        continue;
+                    }
+                    this._buildVenn(i);
+                }
+            }
+            this.addShapeList();
+        },
+        _buildVenn: function (seriesIndex) {
+            var r0;
+            var r1;
+            var serie = this.series[seriesIndex];
+            var data = serie.data;
+            if (data[0].value > data[1].value) {
+                r0 = this.zr.getHeight() / 3;
+                r1 = r0 * Math.sqrt(data[1].value) / Math.sqrt(data[0].value);
+            } else {
+                r1 = this.zr.getHeight() / 3;
+                r0 = r1 * Math.sqrt(data[0].value) / Math.sqrt(data[1].value);
+            }
+            var x0 = this.zr.getWidth() / 2 - r0;
+            var coincideLengthAnchor = (r0 + r1) / 2 * Math.sqrt(data[2].value) / Math.sqrt((data[0].value + data[1].value) / 2);
+            var coincideLength = r0 + r1;
+            if (data[2].value !== 0) {
+                coincideLength = this._getCoincideLength(data[0].value, data[1].value, data[2].value, r0, r1, coincideLengthAnchor, Math.abs(r0 - r1), r0 + r1);
+            }
+            var x1 = x0 + coincideLength;
+            var y = this.zr.getHeight() / 2;
+            this._buildItem(seriesIndex, 0, data[0], x0, y, r0);
+            this._buildItem(seriesIndex, 1, data[1], x1, y, r1);
+            if (data[2].value !== 0 && data[2].value !== data[0].value && data[2].value !== data[1].value) {
+                var xLeft = (r0 * r0 - r1 * r1) / (2 * coincideLength) + coincideLength / 2;
+                var xRight = coincideLength / 2 - (r0 * r0 - r1 * r1) / (2 * coincideLength);
+                var h = Math.sqrt(r0 * r0 - xLeft * xLeft);
+                var rightLargeArcFlag = 0;
+                var leftLargeArcFlag = 0;
+                if (data[0].value > data[1].value && x1 < x0 + xLeft) {
+                    leftLargeArcFlag = 1;
+                }
+                if (data[0].value < data[1].value && x1 < x0 + xRight) {
+                    rightLargeArcFlag = 1;
+                }
+                this._buildCoincideItem(seriesIndex, 2, data[2], x0 + xLeft, y - h, y + h, r0, r1, rightLargeArcFlag, leftLargeArcFlag);
+            }
+        },
+        _getCoincideLength: function (value0, value1, value2, r0, r1, coincideLengthAnchor, coincideLengthAnchorMin, coincideLengthAnchorMax) {
+            var x = (r0 * r0 - r1 * r1) / (2 * coincideLengthAnchor) + coincideLengthAnchor / 2;
+            var y = coincideLengthAnchor / 2 - (r0 * r0 - r1 * r1) / (2 * coincideLengthAnchor);
+            var alfa = Math.acos(x / r0);
+            var beta = Math.acos(y / r1);
+            var area0 = r0 * r0 * Math.PI;
+            var area2 = alfa * r0 * r0 - x * r0 * Math.sin(alfa) + beta * r1 * r1 - y * r1 * Math.sin(beta);
+            var scaleAnchor = area2 / area0;
+            var scale = value2 / value0;
+            var approximateValue = Math.abs(scaleAnchor / scale);
+            if (approximateValue > 0.999 && approximateValue < 1.001) {
+                return coincideLengthAnchor;
+            } else if (approximateValue <= 0.999) {
+                coincideLengthAnchorMax = coincideLengthAnchor;
+                coincideLengthAnchor = (coincideLengthAnchor + coincideLengthAnchorMin) / 2;
+                return this._getCoincideLength(value0, value1, value2, r0, r1, coincideLengthAnchor, coincideLengthAnchorMin, coincideLengthAnchorMax);
+            } else {
+                coincideLengthAnchorMin = coincideLengthAnchor;
+                coincideLengthAnchor = (coincideLengthAnchor + coincideLengthAnchorMax) / 2;
+                return this._getCoincideLength(value0, value1, value2, r0, r1, coincideLengthAnchor, coincideLengthAnchorMin, coincideLengthAnchorMax);
+            }
+        },
+        _buildItem: function (seriesIndex, dataIndex, dataItem, x, y, r) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var circle = this.getCircle(seriesIndex, dataIndex, dataItem, x, y, r);
+            ecData.pack(circle, serie, seriesIndex, dataItem, dataIndex, dataItem.name);
+            this.shapeList.push(circle);
+            if (serie.itemStyle.normal.label.show) {
+                var label = this.getLabel(seriesIndex, dataIndex, dataItem, x, y, r);
+                ecData.pack(label, serie, seriesIndex, serie.data[dataIndex], dataIndex, serie.data[dataIndex].name);
+                this.shapeList.push(label);
+            }
+        },
+        _buildCoincideItem: function (seriesIndex, dataIndex, dataItem, x, y0, y1, r0, r1, rightLargeArcFlag, leftLargeArcFlag) {
+            var series = this.series;
+            var serie = series[seriesIndex];
+            var queryTarget = [
+                dataItem,
+                serie
+            ];
+            var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {};
+            var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {};
+            var normalColor = normal.color || this.zr.getColor(dataIndex);
+            var emphasisColor = emphasis.color || this.zr.getColor(dataIndex);
+            var path = 'M' + x + ',' + y0 + 'A' + r0 + ',' + r0 + ',0,' + rightLargeArcFlag + ',1,' + x + ',' + y1 + 'A' + r1 + ',' + r1 + ',0,' + leftLargeArcFlag + ',1,' + x + ',' + y0;
+            var style = {
+                color: normalColor,
+                path: path
+            };
+            var shape = {
+                zlevel: serie.zlevel,
+                z: serie.z,
+                style: style,
+                highlightStyle: {
+                    color: emphasisColor,
+                    lineWidth: emphasis.borderWidth,
+                    strokeColor: emphasis.borderColor
+                }
+            };
+            shape = new PathShape(shape);
+            if (shape.buildPathArray) {
+                shape.style.pathArray = shape.buildPathArray(style.path);
+            }
+            ecData.pack(shape, series[seriesIndex], 0, dataItem, dataIndex, dataItem.name);
+            this.shapeList.push(shape);
+        },
+        getCircle: function (seriesIndex, dataIndex, dataItem, x, y, r) {
+            var serie = this.series[seriesIndex];
+            var queryTarget = [
+                dataItem,
+                serie
+            ];
+            var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {};
+            var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {};
+            var normalColor = normal.color || this.zr.getColor(dataIndex);
+            var emphasisColor = emphasis.color || this.zr.getColor(dataIndex);
+            var circle = {
+                zlevel: serie.zlevel,
+                z: serie.z,
+                clickable: true,
+                style: {
+                    x: x,
+                    y: y,
+                    r: r,
+                    brushType: 'fill',
+                    opacity: 1,
+                    color: normalColor
+                },
+                highlightStyle: {
+                    color: emphasisColor,
+                    lineWidth: emphasis.borderWidth,
+                    strokeColor: emphasis.borderColor
+                }
+            };
+            if (this.deepQuery([
+                    dataItem,
+                    serie,
+                    this.option
+                ], 'calculable')) {
+                this.setCalculable(circle);
+                circle.draggable = true;
+            }
+            return new CircleShape(circle);
+        },
+        getLabel: function (seriesIndex, dataIndex, dataItem, x, y, r) {
+            var serie = this.series[seriesIndex];
+            var itemStyle = serie.itemStyle;
+            var queryTarget = [
+                dataItem,
+                serie
+            ];
+            var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {};
+            var status = 'normal';
+            var labelControl = itemStyle[status].label;
+            var textStyle = labelControl.textStyle || {};
+            var text = this.getLabelText(dataIndex, dataItem, status);
+            var textFont = this.getFont(textStyle);
+            var textColor = normal.color || this.zr.getColor(dataIndex);
+            var textSize = textStyle.fontSize || 12;
+            var textShape = {
+                zlevel: serie.zlevel,
+                z: serie.z,
+                style: {
+                    x: x,
+                    y: y - r - textSize,
+                    color: textStyle.color || textColor,
+                    text: text,
+                    textFont: textFont,
+                    textAlign: 'center'
+                }
+            };
+            return new TextShape(textShape);
+        },
+        getLabelText: function (dataIndex, dataItem, status) {
+            var series = this.series;
+            var serie = series[0];
+            var formatter = this.deepQuery([
+                dataItem,
+                serie
+            ], 'itemStyle.' + status + '.label.formatter');
+            if (formatter) {
+                if (typeof formatter == 'function') {
+                    return formatter(serie.name, dataItem.name, dataItem.value);
+                } else if (typeof formatter == 'string') {
+                    formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}');
+                    formatter = formatter.replace('{a0}', serie.name).replace('{b0}', dataItem.name).replace('{c0}', dataItem.value);
+                    return formatter;
+                }
+            } else {
+                return dataItem.name;
+            }
+        },
+        refresh: function (newOption) {
+            if (newOption) {
+                this.option = newOption;
+                this.series = newOption.series;
+            }
+            this._buildShape();
+        }
+    };
+    zrUtil.inherits(Venn, ChartBase);
+    require('../chart').define('venn', Venn);
+    return Venn;
+});define('zrender/shape/Path', [
+    'require',
+    './Base',
+    './util/PathProxy',
+    '../tool/util'
+], function (require) {
+    var Base = require('./Base');
+    var PathProxy = require('./util/PathProxy');
+    var PathSegment = PathProxy.PathSegment;
+    var vMag = function (v) {
+        return Math.sqrt(v[0] * v[0] + v[1] * v[1]);
+    };
+    var vRatio = function (u, v) {
+        return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));
+    };
+    var vAngle = function (u, v) {
+        return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));
+    };
+    var Path = function (options) {
+        Base.call(this, options);
+    };
+    Path.prototype = {
+        type: 'path',
+        buildPathArray: function (data, x, y) {
+            if (!data) {
+                return [];
+            }
+            x = x || 0;
+            y = y || 0;
+            var cs = data;
+            var cc = [
+                'm',
+                'M',
+                'l',
+                'L',
+                'v',
+                'V',
+                'h',
+                'H',
+                'z',
+                'Z',
+                'c',
+                'C',
+                'q',
+                'Q',
+                't',
+                'T',
+                's',
+                'S',
+                'a',
+                'A'
+            ];
+            cs = cs.replace(/-/g, ' -');
+            cs = cs.replace(/  /g, ' ');
+            cs = cs.replace(/ /g, ',');
+            cs = cs.replace(/,,/g, ',');
+            var n;
+            for (n = 0; n < cc.length; n++) {
+                cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);
+            }
+            var arr = cs.split('|');
+            var ca = [];
+            var cpx = 0;
+            var cpy = 0;
+            for (n = 1; n < arr.length; n++) {
+                var str = arr[n];
+                var c = str.charAt(0);
+                str = str.slice(1);
+                str = str.replace(new RegExp('e,-', 'g'), 'e-');
+                var p = str.split(',');
+                if (p.length > 0 && p[0] === '') {
+                    p.shift();
+                }
+                for (var i = 0; i < p.length; i++) {
+                    p[i] = parseFloat(p[i]);
+                }
+                while (p.length > 0) {
+                    if (isNaN(p[0])) {
+                        break;
+                    }
+                    var cmd = null;
+                    var points = [];
+                    var ctlPtx;
+                    var ctlPty;
+                    var prevCmd;
+                    var rx;
+                    var ry;
+                    var psi;
+                    var fa;
+                    var fs;
+                    var x1 = cpx;
+                    var y1 = cpy;
+                    switch (c) {
+                    case 'l':
+                        cpx += p.shift();
+                        cpy += p.shift();
+                        cmd = 'L';
+                        points.push(cpx, cpy);
+                        break;
+                    case 'L':
+                        cpx = p.shift();
+                        cpy = p.shift();
+                        points.push(cpx, cpy);
+                        break;
+                    case 'm':
+                        cpx += p.shift();
+                        cpy += p.shift();
+                        cmd = 'M';
+                        points.push(cpx, cpy);
+                        c = 'l';
+                        break;
+                    case 'M':
+                        cpx = p.shift();
+                        cpy = p.shift();
+                        cmd = 'M';
+                        points.push(cpx, cpy);
+                        c = 'L';
+                        break;
+                    case 'h':
+                        cpx += p.shift();
+                        cmd = 'L';
+                        points.push(cpx, cpy);
+                        break;
+                    case 'H':
+                        cpx = p.shift();
+                        cmd = 'L';
+                        points.push(cpx, cpy);
+                        break;
+                    case 'v':
+                        cpy += p.shift();
+                        cmd = 'L';
+                        points.push(cpx, cpy);
+                        break;
+                    case 'V':
+                        cpy = p.shift();
+                        cmd = 'L';
+                        points.push(cpx, cpy);
+                        break;
+                    case 'C':
+                        points.push(p.shift(), p.shift(), p.shift(), p.shift());
+                        cpx = p.shift();
+                        cpy = p.shift();
+                        points.push(cpx, cpy);
+                        break;
+                    case 'c':
+                        points.push(cpx + p.shift(), cpy + p.shift(), cpx + p.shift(), cpy + p.shift());
+                        cpx += p.shift();
+                        cpy += p.shift();
+                        cmd = 'C';
+                        points.push(cpx, cpy);
+                        break;
+                    case 'S':
+                        ctlPtx = cpx;
+                        ctlPty = cpy;
+                        prevCmd = ca[ca.length - 1];
+                        if (prevCmd.command === 'C') {
+                            ctlPtx = cpx + (cpx - prevCmd.points[2]);
+                            ctlPty = cpy + (cpy - prevCmd.points[3]);
+                        }
+                        points.push(ctlPtx, ctlPty, p.shift(), p.shift());
+                        cpx = p.shift();
+                        cpy = p.shift();
+                        cmd = 'C';
+                        points.push(cpx, cpy);
+                        break;
+                    case 's':
+                        ctlPtx = cpx, ctlPty = cpy;
+                        prevCmd = ca[ca.length - 1];
+                        if (prevCmd.command === 'C') {
+                            ctlPtx = cpx + (cpx - prevCmd.points[2]);
+                            ctlPty = cpy + (cpy - prevCmd.points[3]);
+                        }
+                        points.push(ctlPtx, ctlPty, cpx + p.shift(), cpy + p.shift());
+                        cpx += p.shift();
+                        cpy += p.shift();
+                        cmd = 'C';
+                        points.push(cpx, cpy);
+                        break;
+                    case 'Q':
+                        points.push(p.shift(), p.shift());
+                        cpx = p.shift();
+                        cpy = p.shift();
+                        points.push(cpx, cpy);
+                        break;
+                    case 'q':
+                        points.push(cpx + p.shift(), cpy + p.shift());
+                        cpx += p.shift();
+                        cpy += p.shift();
+                        cmd = 'Q';
+                        points.push(cpx, cpy);
+                        break;
+                    case 'T':
+                        ctlPtx = cpx, ctlPty = cpy;
+                        prevCmd = ca[ca.length - 1];
+                        if (prevCmd.command === 'Q') {
+                            ctlPtx = cpx + (cpx - prevCmd.points[0]);
+                            ctlPty = cpy + (cpy - prevCmd.points[1]);
+                        }
+                        cpx = p.shift();
+                        cpy = p.shift();
+                        cmd = 'Q';
+                        points.push(ctlPtx, ctlPty, cpx, cpy);
+                        break;
+                    case 't':
+                        ctlPtx = cpx, ctlPty = cpy;
+                        prevCmd = ca[ca.length - 1];
+                        if (prevCmd.command === 'Q') {
+                            ctlPtx = cpx + (cpx - prevCmd.points[0]);
+                            ctlPty = cpy + (cpy - prevCmd.points[1]);
+                        }
+                        cpx += p.shift();
+                        cpy += p.shift();
+                        cmd = 'Q';
+                        points.push(ctlPtx, ctlPty, cpx, cpy);
+                        break;
+                    case 'A':
+                        rx = p.shift();
+                        ry = p.shift();
+                        psi = p.shift();
+                        fa = p.shift();
+                        fs = p.shift();
+                        x1 = cpx, y1 = cpy;
+                        cpx = p.shift(), cpy = p.shift();
+                        cmd = 'A';
+                        points = this._convertPoint(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);
+                        break;
+                    case 'a':
+                        rx = p.shift();
+                        ry = p.shift();
+                        psi = p.shift();
+                        fa = p.shift();
+                        fs = p.shift();
+                        x1 = cpx, y1 = cpy;
+                        cpx += p.shift();
+                        cpy += p.shift();
+                        cmd = 'A';
+                        points = this._convertPoint(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);
+                        break;
+                    }
+                    for (var j = 0, l = points.length; j < l; j += 2) {
+                        points[j] += x;
+                        points[j + 1] += y;
+                    }
+                    ca.push(new PathSegment(cmd || c, points));
+                }
+                if (c === 'z' || c === 'Z') {
+                    ca.push(new PathSegment('z', []));
+                }
+            }
+            return ca;
+        },
+        _convertPoint: function (x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) {
+            var psi = psiDeg * (Math.PI / 180);
+            var xp = Math.cos(psi) * (x1 - x2) / 2 + Math.sin(psi) * (y1 - y2) / 2;
+            var yp = -1 * Math.sin(psi) * (x1 - x2) / 2 + Math.cos(psi) * (y1 - y2) / 2;
+            var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);
+            if (lambda > 1) {
+                rx *= Math.sqrt(lambda);
+                ry *= Math.sqrt(lambda);
+            }
+            var f = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / (rx * rx * (yp * yp) + ry * ry * (xp * xp)));
+            if (fa === fs) {
+                f *= -1;
+            }
+            if (isNaN(f)) {
+                f = 0;
+            }
+            var cxp = f * rx * yp / ry;
+            var cyp = f * -ry * xp / rx;
+            var cx = (x1 + x2) / 2 + Math.cos(psi) * cxp - Math.sin(psi) * cyp;
+            var cy = (y1 + y2) / 2 + Math.sin(psi) * cxp + Math.cos(psi) * cyp;
+            var theta = vAngle([
+                1,
+                0
+            ], [
+                (xp - cxp) / rx,
+                (yp - cyp) / ry
+            ]);
+            var u = [
+                (xp - cxp) / rx,
+                (yp - cyp) / ry
+            ];
+            var v = [
+                (-1 * xp - cxp) / rx,
+                (-1 * yp - cyp) / ry
+            ];
+            var dTheta = vAngle(u, v);
+            if (vRatio(u, v) <= -1) {
+                dTheta = Math.PI;
+            }
+            if (vRatio(u, v) >= 1) {
+                dTheta = 0;
+            }
+            if (fs === 0 && dTheta > 0) {
+                dTheta = dTheta - 2 * Math.PI;
+            }
+            if (fs === 1 && dTheta < 0) {
+                dTheta = dTheta + 2 * Math.PI;
+            }
+            return [
+                cx,
+                cy,
+                rx,
+                ry,
+                theta,
+                dTheta,
+                psi,
+                fs
+            ];
+        },
+        buildPath: function (ctx, style) {
+            var path = style.path;
+            var x = style.x || 0;
+            var y = style.y || 0;
+            style.pathArray = style.pathArray || this.buildPathArray(path, x, y);
+            var pathArray = style.pathArray;
+            var pointList = style.pointList = [];
+            var singlePointList = [];
+            for (var i = 0, l = pathArray.length; i < l; i++) {
+                if (pathArray[i].command.toUpperCase() == 'M') {
+                    singlePointList.length > 0 && pointList.push(singlePointList);
+                    singlePointList = [];
+                }
+                var p = pathArray[i].points;
+                for (var j = 0, k = p.length; j < k; j += 2) {
+                    singlePointList.push([
+                        p[j],
+                        p[j + 1]
+                    ]);
+                }
+            }
+            singlePointList.length > 0 && pointList.push(singlePointList);
+            for (var i = 0, l = pathArray.length; i < l; i++) {
+                var c = pathArray[i].command;
+                var p = pathArray[i].points;
+                switch (c) {
+                case 'L':
+                    ctx.lineTo(p[0], p[1]);
+                    break;
+                case 'M':
+                    ctx.moveTo(p[0], p[1]);
+                    break;
+                case 'C':
+                    ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]);
+                    break;
+                case 'Q':
+                    ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]);
+                    break;
+                case 'A':
+                    var cx = p[0];
+                    var cy = p[1];
+                    var rx = p[2];
+                    var ry = p[3];
+                    var theta = p[4];
+                    var dTheta = p[5];
+                    var psi = p[6];
+                    var fs = p[7];
+                    var r = rx > ry ? rx : ry;
+                    var scaleX = rx > ry ? 1 : rx / ry;
+                    var scaleY = rx > ry ? ry / rx : 1;
+                    ctx.translate(cx, cy);
+                    ctx.rotate(psi);
+                    ctx.scale(scaleX, scaleY);
+                    ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs);
+                    ctx.scale(1 / scaleX, 1 / scaleY);
+                    ctx.rotate(-psi);
+                    ctx.translate(-cx, -cy);
+                    break;
+                case 'z':
+                    ctx.closePath();
+                    break;
+                }
+            }
+            return;
+        },
+        getRect: function (style) {
+            if (style.__rect) {
+                return style.__rect;
+            }
+            var lineWidth;
+            if (style.brushType == 'stroke' || style.brushType == 'fill') {
+                lineWidth = style.lineWidth || 1;
+            } else {
+                lineWidth = 0;
+            }
+            var minX = Number.MAX_VALUE;
+            var maxX = Number.MIN_VALUE;
+            var minY = Number.MAX_VALUE;
+            var maxY = Number.MIN_VALUE;
+            var x = style.x || 0;
+            var y = style.y || 0;
+            var pathArray = style.pathArray || this.buildPathArray(style.path);
+            for (var i = 0; i < pathArray.length; i++) {
+                var p = pathArray[i].points;
+                for (var j = 0; j < p.length; j++) {
+                    if (j % 2 === 0) {
+                        if (p[j] + x < minX) {
+                            minX = p[j];
+                        }
+                        if (p[j] + x > maxX) {
+                            maxX = p[j];
+                        }
+                    } else {
+                        if (p[j] + y < minY) {
+                            minY = p[j];
+                        }
+                        if (p[j] + y > maxY) {
+                            maxY = p[j];
+                        }
+                    }
+                }
+            }
+            var rect;
+            if (minX === Number.MAX_VALUE || maxX === Number.MIN_VALUE || minY === Number.MAX_VALUE || maxY === Number.MIN_VALUE) {
+                rect = {
+                    x: 0,
+                    y: 0,
+                    width: 0,
+                    height: 0
+                };
+            } else {
+                rect = {
+                    x: Math.round(minX - lineWidth / 2),
+                    y: Math.round(minY - lineWidth / 2),
+                    width: maxX - minX + lineWidth,
+                    height: maxY - minY + lineWidth
+                };
+            }
+            style.__rect = rect;
+            return rect;
+        }
+    };
+    require('../tool/util').inherits(Path, Base);
+    return Path;
+});

File diff suppressed because it is too large
+ 2120 - 0
src/main/webapp/static/echarts-2.2.7/build/source/chart/wordCloud.js


File diff suppressed because it is too large
+ 49884 - 0
src/main/webapp/static/echarts-2.2.7/build/source/echarts-all.js


File diff suppressed because it is too large
+ 23202 - 0
src/main/webapp/static/echarts-2.2.7/build/source/echarts.js