From 54954508a6094db5dd84bd72d13a42b13090ee86 Mon Sep 17 00:00:00 2001 From: quick-sort Date: Wed, 10 Apr 2019 12:00:18 +0800 Subject: [PATCH 1/3] fix #10248 --- src/model/mixin/dataFormat.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/model/mixin/dataFormat.js b/src/model/mixin/dataFormat.js index 7d48b526b6..1bda568930 100644 --- a/src/model/mixin/dataFormat.js +++ b/src/model/mixin/dataFormat.js @@ -94,6 +94,12 @@ export default { ); if (typeof formatter === 'function') { + if ((params.value instanceof Array) && dimIndex == null) { + let labelDims = data.mapDimension('defaultedLabel', true) + if (labelDims instanceof Array) { + params.value = labelDims.map(i => retrieveRawValue(data, dataIndex, i)) + } + } params.status = status; return formatter(params); } From cfb4b9b80f0325c5cc3bd1aae16eee098b4c0da8 Mon Sep 17 00:00:00 2001 From: quick-sort Date: Wed, 10 Apr 2019 16:27:51 +0800 Subject: [PATCH 2/3] fix #10248 --- src/model/mixin/dataFormat.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/model/mixin/dataFormat.js b/src/model/mixin/dataFormat.js index 1bda568930..ab708a9b66 100644 --- a/src/model/mixin/dataFormat.js +++ b/src/model/mixin/dataFormat.js @@ -20,6 +20,7 @@ import {retrieveRawValue} from '../../data/helper/dataProvider'; import {getTooltipMarker, formatTpl} from '../../util/format'; import { getTooltipRenderMode } from '../../util/model'; +import * as zrUtil from 'zrender/src/core/util'; var DIMENSION_LABEL_REG = /\{@(.+?)\}/g; @@ -94,10 +95,12 @@ export default { ); if (typeof formatter === 'function') { - if ((params.value instanceof Array) && dimIndex == null) { - let labelDims = data.mapDimension('defaultedLabel', true) - if (labelDims instanceof Array) { - params.value = labelDims.map(i => retrieveRawValue(data, dataIndex, i)) + if (zrUtil.isArray(params.value) && dimIndex == null) { + var labelDims = data.mapDimension('defaultedLabel', true); + if (zrUtil.isArray(labelDims)) { + params.value = labelDims.map(function(i) { + return retrieveRawValue(data, dataIndex, i); + }); } } params.status = status; From d35a03d3f789900920f2f922bb0eb9e25fe35bb3 Mon Sep 17 00:00:00 2001 From: sushuang Date: Tue, 18 Jun 2019 22:49:02 +0800 Subject: [PATCH 3/3] Add dimensions and encode info to formatter params. --- src/model/mixin/dataFormat.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/model/mixin/dataFormat.js b/src/model/mixin/dataFormat.js index ab708a9b66..c02b380637 100644 --- a/src/model/mixin/dataFormat.js +++ b/src/model/mixin/dataFormat.js @@ -20,7 +20,6 @@ import {retrieveRawValue} from '../../data/helper/dataProvider'; import {getTooltipMarker, formatTpl} from '../../util/format'; import { getTooltipRenderMode } from '../../util/model'; -import * as zrUtil from 'zrender/src/core/util'; var DIMENSION_LABEL_REG = /\{@(.+?)\}/g; @@ -59,6 +58,8 @@ export default { dataType: dataType, value: rawValue, color: color, + dimensions: data.userOutput.dimensions, + encode: data.userOutput.encode, marker: getTooltipMarker({ color: color, renderMode: renderMode @@ -95,14 +96,6 @@ export default { ); if (typeof formatter === 'function') { - if (zrUtil.isArray(params.value) && dimIndex == null) { - var labelDims = data.mapDimension('defaultedLabel', true); - if (zrUtil.isArray(labelDims)) { - params.value = labelDims.map(function(i) { - return retrieveRawValue(data, dataIndex, i); - }); - } - } params.status = status; return formatter(params); }