You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2020/04/28 16:42:57 UTC

[incubator-echarts] 02/02: fix: tweak emphasis text position.

This is an automated email from the ASF dual-hosted git repository.

sushuang pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 270839676f5744ad72bf0c43138e38e3e9cd6f30
Author: 100pah <su...@gmail.com>
AuthorDate: Wed Apr 29 00:42:09 2020 +0800

    fix: tweak emphasis text position.
---
 src/util/graphic.ts  | 10 ++++++----
 test/hoverStyle.html | 11 ++++++++++-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/util/graphic.ts b/src/util/graphic.ts
index 69b435a..2875480 100644
--- a/src/util/graphic.ts
+++ b/src/util/graphic.ts
@@ -705,13 +705,15 @@ export function setLabelStyle<LDI>(
             targetEl.setTextConfig(createTextConfig(
                 normalStyle,
                 normalModel,
-                opt
+                opt,
+                false
             ));
             const targetElEmphasisState = targetEl.ensureState('emphasis');
             targetElEmphasisState.textConfig = createTextConfig(
                 emphasisState.style,
                 emphasisModel,
-                opt
+                opt,
+                true
             );
         }
 
@@ -765,8 +767,8 @@ export function createTextStyle(
 export function createTextConfig(
     textStyle: TextStyleProps,
     textStyleModel: Model,
-    opt?: TextCommonParams,
-    isEmphasis?: boolean
+    opt: TextCommonParams,
+    isEmphasis: boolean
 ) {
     const textConfig: ElementTextConfig = {};
     let labelPosition;
diff --git a/test/hoverStyle.html b/test/hoverStyle.html
index 4fd2b48..6a5bca7 100644
--- a/test/hoverStyle.html
+++ b/test/hoverStyle.html
@@ -368,7 +368,16 @@ under the License.
                         type: 'scatter',
                         symbolSize: 30,
                         data: [
-                            [12, 331], [55, 131], [55, 531]
+                            {
+                                value: [12, 331],
+                                label: {
+                                    show: true,
+                                    formatter: 'position top\neven hoverred',
+                                    fontSize: 20,
+                                    position: 'top'
+                                }
+                            },
+                            [55, 131], [55, 531]
                         ]
                     }, {
                         type: 'scatter',


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org