You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2021/11/01 08:33:21 UTC

[echarts] branch fix-15915 created (now 28c059d)

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

ovilia pushed a change to branch fix-15915
in repository https://gitbox.apache.org/repos/asf/echarts.git.


      at 28c059d  fix(radar): name being - in tooltip when name.show is false #15915

This branch includes the following new commits:

     new 28c059d  fix(radar): name being - in tooltip when name.show is false #15915

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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


[echarts] 01/01: fix(radar): name being - in tooltip when name.show is false #15915

Posted by ov...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ovilia pushed a commit to branch fix-15915
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit 28c059d88e6765faffb3a6b74e56adb019e87244
Author: Ovilia <zw...@gmail.com>
AuthorDate: Mon Nov 1 16:32:08 2021 +0800

    fix(radar): name being - in tooltip when name.show is false #15915
---
 src/component/radar/RadarView.ts       | 4 ++++
 src/coord/radar/RadarModel.ts          | 5 ++---
 src/preprocessor/helper/compatStyle.ts | 5 +++++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/component/radar/RadarView.ts b/src/component/radar/RadarView.ts
index 430ec27..1b3c11f 100644
--- a/src/component/radar/RadarView.ts
+++ b/src/component/radar/RadarView.ts
@@ -47,7 +47,11 @@ class RadarView extends ComponentView {
         const radar = radarModel.coordinateSystem;
         const indicatorAxes = radar.getIndicatorAxes();
         const axisBuilders = zrUtil.map(indicatorAxes, function (indicatorAxis) {
+            const axisName = indicatorAxis.model.get('showName')
+                ? indicatorAxis.name
+                : ''; // hide name
             const axisBuilder = new AxisBuilder(indicatorAxis.model, {
+                axisName: axisName,
                 position: [radar.cx, radar.cy],
                 rotation: indicatorAxis.angle,
                 labelDirection: -1,
diff --git a/src/coord/radar/RadarModel.ts b/src/coord/radar/RadarModel.ts
index cdcd3e8..94007bb 100644
--- a/src/coord/radar/RadarModel.ts
+++ b/src/coord/radar/RadarModel.ts
@@ -88,6 +88,7 @@ export interface RadarOption extends ComponentOption, CircleLayoutOptionMixin {
 export type InnerIndicatorAxisOption = AxisBaseOption & {
     // TODO Use type?
     // axisType?: 'value' | 'log'
+    showName?: boolean
 };
 
 class RadarModel extends ComponentModel<RadarOption> implements CoordinateSystemHostModel {
@@ -137,15 +138,13 @@ class RadarModel extends ComponentModel<RadarOption> implements CoordinateSystem
                 axisLabel: axisLabel,
                 // Compatible with 2 and use text
                 name: indicatorOpt.text,
+                showName: showName,
                 nameLocation: 'end',
                 nameGap: nameGap,
                 // min: 0,
                 nameTextStyle: iNameTextStyle,
                 triggerEvent: triggerEvent
             } as InnerIndicatorAxisOption, false);
-            if (!showName) {
-                innerIndicatorOpt.name = '';
-            }
             if (typeof nameFormatter === 'string') {
                 const indName = innerIndicatorOpt.name;
                 innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');
diff --git a/src/preprocessor/helper/compatStyle.ts b/src/preprocessor/helper/compatStyle.ts
index 215e0fd..7d74555 100644
--- a/src/preprocessor/helper/compatStyle.ts
+++ b/src/preprocessor/helper/compatStyle.ts
@@ -307,6 +307,11 @@ export default function globalCompatStyle(option: any, isTheme?: boolean) {
                 deprecateLog('nameGap property in radar component has been changed to axisNameGap');
             }
         }
+        each(radarOpt.indicator, function (indicatorOpt: any) {
+            if (__DEV__ && indicatorOpt.text) {
+                deprecateReplaceLog('text', 'name', 'radar.indicator');
+            }
+        });
     });
 
     each(toArr(option.geo), function (geoOpt) {

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