diff --git a/src/chart/lines/LinesSeries.js b/src/chart/lines/LinesSeries.js index fcbbf6c8f5f08970989c0fb9eea87deb10cf3d55..8c613426903c6125baf8c0a4fd1de8c4d1fad397 100644 --- a/src/chart/lines/LinesSeries.js +++ b/src/chart/lines/LinesSeries.js @@ -37,7 +37,7 @@ define(function (require) { var lineData = new List(['value'], this); function geoCoordGetter(item, dim, dataIndex, dimIndex) { - return item.geoCoord && item.geoCoord[dimIndex]; + return item.coord && item.coord[dimIndex]; } fromData.initData(fromDataArr, null, geoCoordGetter); diff --git a/src/chart/map/MapSeries.js b/src/chart/map/MapSeries.js index 284cf4e7cf8708bed724a27a10a7fb79b501fd3c..c1c6350ecad550910f17f957a97f98f55703cbf0 100644 --- a/src/chart/map/MapSeries.js +++ b/src/chart/map/MapSeries.js @@ -191,7 +191,7 @@ define(function (require) { }, // 也是选中样式 emphasis: { - areaColor: 'rgba(255,215,0,0.8)' + areaColor: 'rgba(255,215, 0, 0.8)' } } } diff --git a/src/component/marker/MarkLineView.js b/src/component/marker/MarkLineView.js index 6417c7797264073f75bda5a59bfea55a9aa54f11..90101a6d62a76f2e18e75a352b1ec13a7427d0d1 100644 --- a/src/component/marker/MarkLineView.js +++ b/src/component/marker/MarkLineView.js @@ -18,7 +18,7 @@ define(function (require) { var mlType = item.type; if (!zrUtil.isArray(item) && mlType === 'min' || mlType === 'max' || mlType === 'average' - ) { + ) { if (item.valueIndex != null) { baseAxis = coordSys.getAxis(coordSys.dimensions[1 - item.valueIndex]); valueAxis = coordSys.getAxis(coordSys.dimensions[item.valueIndex]); @@ -48,7 +48,6 @@ define(function (require) { mlFrom[valueAxisKey] = mlTo[valueAxisKey] = value; item = [mlFrom, mlTo, { // Extra option for tooltip and label - __rawValue: value, type: mlType }]; } @@ -81,11 +80,6 @@ define(function (require) { + ((name ? encodeHTML(name) + ' : ' : '') + formattedValue); }, - getRawValue: function (idx) { - var option = this._data.getItemModel(idx).option; - return zrUtil.retrieve(option && option.__rawValue, option && option.value, ''); - }, - getRawDataArray: function () { return this.option.data; }, @@ -257,10 +251,14 @@ define(function (require) { zrUtil.curry(markLineFilter, coordSys) ); fromData.initData( - zrUtil.map(optData, function (item) { return item[0]; }) + zrUtil.map(optData, function (item) { return item[0]; }), + null, + markerHelper.dimValueGetter ); toData.initData( - zrUtil.map(optData, function (item) { return item[1]; }) + zrUtil.map(optData, function (item) { return item[1]; }), + null, + markerHelper.dimValueGetter ); lineData.initData( zrUtil.map(optData, function (item) { return item[2]; }) diff --git a/src/component/marker/MarkPointView.js b/src/component/marker/MarkPointView.js index 4c153ca9135e659f6f9d8b24964f18d45279529e..9b03e8884d9e43de2ffb9c93910fb1165e187d53 100644 --- a/src/component/marker/MarkPointView.js +++ b/src/component/marker/MarkPointView.js @@ -29,11 +29,6 @@ define(function (require) { + ((name ? encodeHTML(name) + ' : ' : '') + formattedValue); }, - getRawValue: function (idx) { - var option = this._data.getItemModel(idx).option; - return zrUtil.retrieve(option.__rawValue, option.value, ''); - }, - getData: function () { return this._data; }, @@ -153,7 +148,9 @@ define(function (require) { markerHelper.dataTransform, seriesData, coordSys )), zrUtil.curry(markerHelper.dataFilter, coordSys) - ) + ), + null, + markerHelper.dimValueGetter ); } diff --git a/src/component/marker/markerHelper.js b/src/component/marker/markerHelper.js index 6dce916c80554a7db49963c2b137270ebabcd5a7..069e01648cd68cdf490e8171d7d1e4bb271ca037 100644 --- a/src/component/marker/markerHelper.js +++ b/src/component/marker/markerHelper.js @@ -20,20 +20,20 @@ define(function (require) { function markerTypeCalculatorWithExtent(percent, data, baseAxisDim, valueAxisDim, valueIndex) { var extent = data.getDataExtent(valueAxisDim); - var valueArr = []; + var coordArr = []; var min = extent[0]; var max = extent[1]; var val = (max - min) * percent + min; var dataIndex = data.indexOfNearest(valueAxisDim, val); - valueArr[1 - valueIndex] = data.get(baseAxisDim, dataIndex); - valueArr[valueIndex] = data.get(valueAxisDim, dataIndex, true); + coordArr[1 - valueIndex] = data.get(baseAxisDim, dataIndex); + coordArr[valueIndex] = data.get(valueAxisDim, dataIndex, true); var precision = getPrecision(data, valueAxisDim, dataIndex); if (precision >= 0) { - valueArr[valueIndex] = +valueArr[valueIndex].toFixed(precision); + coordArr[valueIndex] = +coordArr[valueIndex].toFixed(precision); } - return valueArr; + return coordArr; } var curry = zrUtil.curry; @@ -65,7 +65,7 @@ define(function (require) { /** * Transform markPoint data item to format used in List by do the following * 1. Calculate statistic like `max`, `min`, `average` - * 2. Convert `item.xAxis`, `item.yAxis` to `item.value` array + * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array * @param {module:echarts/data/List} data * @param {module:echarts/coord/*} [coordSys] * @param {Object} item @@ -73,9 +73,9 @@ define(function (require) { */ var dataTransform = function (data, coordSys, item) { // 1. If not specify the position with pixel directly - // 2. If value is not a data array. Which uses xAxis, yAxis to specify the value on each dimension + // 2. If `coord` is not a data array. Which uses `xAxis`, `yAxis` to specify the coord on each dimension if ((isNaN(item.x) || isNaN(item.y)) - && !zrUtil.isArray(item.value) + && !zrUtil.isArray(item.coord) && coordSys ) { var valueAxisDim; @@ -101,26 +101,17 @@ define(function (require) { // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value item = zrUtil.extend({}, item); if (item.type && markerTypeCalculator[item.type] && baseAxis && valueAxis) { - var value = markerTypeCalculator[item.type]( + item.coord = markerTypeCalculator[item.type]( data, baseAxis.dim, valueAxisDim, valueIndex ); - if (item.value != null) { - value.push(+item.value); - } - item.value = value; } else { - var originalValue = item.value; // FIXME Only has one of xAxis and yAxis. - item.value = [ + item.coord = [ item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis ]; - if (originalValue != null) { - item.value.push(+originalValue); - } } - item.__rawValue = item.value[valueIndex]; } return item; }; @@ -135,12 +126,23 @@ define(function (require) { */ var dataFilter = function (coordSys, item) { // Alwalys return true if there is no coordSys - return (coordSys && item.value && (item.x == null || item.y == null)) - ? coordSys.containData(item.value) : true; + return (coordSys && item.coord && (item.x == null || item.y == null)) + ? coordSys.containData(item.coord) : true; + }; + + var dimValueGetter = function (item, dimName, dataIndex, dimIndex) { + // x, y, radius, angle + if (dimIndex < 2) { + return item.coord && item.coord[dimIndex]; + } + else { + item.value; + } }; return { dataTransform: dataTransform, - dataFilter: dataFilter + dataFilter: dataFilter, + dimValueGetter: dimValueGetter }; }); \ No newline at end of file