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:22 UTC
[echarts] 01/01: fix(radar): name being - in tooltip when name.show
is false #15915
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