diff --git a/.jshintrc-dist b/.jshintrc-dist index ecc42d4e3a53ef0ec5a1b1b2732c18da5ddb5266..e9fd7f739b86efbd530b53056b8a96a794cb6dce 100644 --- a/.jshintrc-dist +++ b/.jshintrc-dist @@ -1,6 +1,6 @@ { "bitwise": false, - "camelcase": true, + "camelcase": false, "curly": true, "eqeqeq": false, "forin": false, diff --git a/src/component/toolbox/feature/DataZoom.js b/src/component/toolbox/feature/DataZoom.js index b4695de4a97970c52ab0b0966e805afa10a071b8..dade91a4e3a832ad88a4bc57da096c27e108c01b 100644 --- a/src/component/toolbox/feature/DataZoom.js +++ b/src/component/toolbox/feature/DataZoom.js @@ -251,6 +251,8 @@ echarts.registerPreprocessor(function (option) { if (toolboxOpt && toolboxOpt.feature) { var dataZoomOpt = toolboxOpt.feature.dataZoom; + // FIXME: If add dataZoom when setOption in merge mode, + // no axis info to be added. See `test/dataZoom-extreme.html` addForAxis('xAxis', dataZoomOpt); addForAxis('yAxis', dataZoomOpt); } diff --git a/src/stream/Scheduler.js b/src/stream/Scheduler.js index ed7f438d2335730ed841632f755124a894585644..6c226e62980cd4d0c39cc2a1f2832278aeb8cb27 100644 --- a/src/stream/Scheduler.js +++ b/src/stream/Scheduler.js @@ -466,7 +466,7 @@ function makeSeriesTaskProgress(resetDefineIdx) { else if (resetDefine && resetDefine.progress) { resetDefine.progress(params, data); } - } + }; } function seriesTaskCount(context) { diff --git a/src/util/format.js b/src/util/format.js index b16f616c535e3a362e8e34705921f7934d2ce78b..3cc7a1c781991650159d953f70702a12051ea32b 100644 --- a/src/util/format.js +++ b/src/util/format.js @@ -42,14 +42,14 @@ var replaceMap = { '<': '<', '>': '>', '"': '"', - '\'': ''', + '\'': ''' }; export function encodeHTML(source) { return source == null ? '' - : (source + '').replace(replaceReg, function (str, char) { - return replaceMap[char]; + : (source + '').replace(replaceReg, function (str, c) { + return replaceMap[c]; }); } diff --git a/test/custom-bmap-polygon.html b/test/custom-bmap-polygon.html index 44760efba885feadcc243fefeefeed1030b64fb6..11e65a959cc085c53071ae328bea7ca1e6248d0c 100644 --- a/test/custom-bmap-polygon.html +++ b/test/custom-bmap-polygon.html @@ -461,7 +461,7 @@ var myChart = echarts.init(document.getElementById('main')); myChart.setOption({ - backgroundColor: '#404a59', + // backgroundColor: '#404a59', title: { text: '全国主要城市空气质量', subtext: 'data from PM25.in', diff --git a/test/custom-children-remove.html b/test/custom-children-remove.html index abb3cd071e249cdf56477e10a54cb34529fa1703..d6949f2093e8fdb9f146ea03fe6d21b43a95da20 100644 --- a/test/custom-children-remove.html +++ b/test/custom-children-remove.html @@ -42,115 +42,100 @@ require([ 'echarts' - // 'echarts/chart/line', - // 'echarts/chart/bar', - // 'echarts/chart/pie', - // 'echarts/chart/scatter', - // 'echarts/chart/custom', - // 'echarts/chart/parallel', - // 'echarts/chart/radar', - // 'echarts/component/grid', - // 'echarts/component/polar', - // 'echarts/component/geo', - // 'echarts/component/singleAxis', - // 'echarts/component/legend', - // 'echarts/component/tooltip', - // 'echarts/component/toolbox', - // 'echarts/component/visualMap', - // 'echarts/component/dataZoom' ], function (ec) { echarts = ec; chart = myChart = echarts.init(document.getElementById('main')); -var data = [ - {name:'广州', value: 50}, - {name:'深圳', value: 72}, - {name:'珠海', value: 30}, - {name:'佛山', value: 38}, - {name:'杭州', value: 42}, - {name:'舟山', value: 32}, - {name:'宁波', value: 52} -]; - - -option = { - tooltip : { - trigger: 'item' - }, - legend: { - data:['广州','深圳','珠海','佛山','杭州','舟山','宁波'], - top: 0, - left: 'center' - }, - xAxis : [ - { - type : 'category', - data : [0], - axisTick: {show: false}, - axisLabel: {show: false} - }, - ], - yAxis : [ - { - type : 'value' - } - ], - series : echarts.util.map(data, function (item) { - return { - name: item.name, - type: 'bar', - label: { - normal: { - show: true, - position: 'bottom', - formatter: function (param) { - return param.seriesName; - } + var data = [ + {name:'广州', value: 50}, + {name:'深圳', value: 72}, + {name:'珠海', value: 30}, + {name:'佛山', value: 38}, + {name:'杭州', value: 42}, + {name:'舟山', value: 32}, + {name:'宁波', value: 52} + ]; + + + option = { + tooltip : { + trigger: 'item' + }, + legend: { + data:['广州','深圳','珠海','佛山','杭州','舟山','宁波'], + top: 0, + left: 'center' + }, + xAxis : [ + { + type : 'category', + data : [0], + axisTick: {show: false}, + axisLabel: {show: false} + }, + ], + yAxis : [ + { + type : 'value' + } + ], + series : echarts.util.map(data, function (item) { + return { + name: item.name, + type: 'bar', + label: { + normal: { + show: true, + position: 'bottom', + formatter: function (param) { + return param.seriesName; + } + } + }, + data: [item.value] + } + }).concat([{ + type: 'custom', + renderItem: renderProvinceName, + data: [0] + }]) + }; + + function renderProvinceName(param, api) { + var currentSeriesIndices = api.currentSeriesIndices(); + currentSeriesIndices.pop(); // remove custom series; + + var barLayout = api.barLayout({ + barGap: '30%', barCategoryGap: '20%', count: currentSeriesIndices.length + }); + + var nameTexts = echarts.util.map(currentSeriesIndices, function (serIdx, index) { + var point = api.coord([0, 0]); + point[0] += barLayout[index].offsetCenter; + point[1] = api.getHeight() - 20; + + return { + position: point, + name: serIdx, + type: 'circle', + shape: { + cx: 0, cy: 0, r: 10 + }, + style: { + text: serIdx, + fill: '#333', + textFill: '#eee', + stroke: null + } + }; + }); + + return { + type: 'group', + diffChildrenByName: true, + children: nameTexts + }; } - }, - data: [item.value] - } - }).concat([{ - type: 'custom', - renderItem: renderProvinceName, - data: [0] - }]) -}; - -function renderProvinceName(param, api) { - var currentSeriesIndices = api.currentSeriesIndices(); - currentSeriesIndices.pop(); // remove custom series; - - var barLayout = api.barLayout({ - barGap: '30%', barCategoryGap: '20%', count: currentSeriesIndices.length - }); - - var nameTexts = echarts.util.map(currentSeriesIndices, function (serIdx, index) { - var point = api.coord([0, 0]); - point[0] += barLayout[index].offsetCenter; - point[1] = api.getHeight() - 20; - - return { - position: point, - name: serIdx, - type: 'circle', - shape: { - cx: 0, cy: 0, r: 10 - }, - style: { - text: serIdx, - fill: '#333', - stroke: null - } - }; - }); - - return { - type: 'group', - diffChildrenByName: true, - children: nameTexts - }; -} chart.setOption(option); }); diff --git a/test/dataZoom-rainfall-inside.html b/test/dataZoom-rainfall-inside.html index 792c59d4b0cbec20f95ff434179ec874b6ebf62b..3161247e5d2b4ca6643e459596589ca9c7ba3df5 100644 --- a/test/dataZoom-rainfall-inside.html +++ b/test/dataZoom-rainfall-inside.html @@ -25,7 +25,7 @@

rainfall

-

zoom lock | Should not prevent default when mouse wheel.

+

zoom lock (only inside) | Should not prevent default when mouse wheel.

zoomOnMouseWheel: 'shift', moveOnMouseMove: 'alt' | Should not prevent default when mouse wheel.

diff --git a/test/graphicRemove.html b/test/graphicRemove.html index 4b488df38c29d550c1e45a0994b7e6e57c1fffa8..2432522febdaf368992bf12669b4fee8dafab3ff 100644 --- a/test/graphicRemove.html +++ b/test/graphicRemove.html @@ -51,13 +51,13 @@ id: 'text1', type: 'rect', shape: { - x:0, - y:0, + x: 0, + y: 0, width: 100, height: 100, - }, - style: { - fill: 'red', + }, + style: { + fill: 'red' } } }; @@ -82,20 +82,25 @@ // }); // 删除后再添加。 myChart.setOption({ - id: 'text1', - type: 'rect', - shape: { - x:0, - y:0, - width: 100, - height: 100, - }, - style: { - fill: 'red', + graphic: { + id: 'text1', + type: 'rect', + shape: { + x:0, + y:0, + width: 100, + height: 100, + }, + style: { + fill: 'red', + } } }); }, 1000); + + document.getElementById('wid').innerText = window.innerWidth; + var hasRect; window.onresize = function() {