diff --git a/common/changes/@visactor/lark-vchart/fix-issue-251_2023-07-27-14-40.json b/common/changes/@visactor/lark-vchart/fix-issue-251_2023-07-27-14-40.json new file mode 100644 index 0000000000..910011aa44 --- /dev/null +++ b/common/changes/@visactor/lark-vchart/fix-issue-251_2023-07-27-14-40.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/lark-vchart", + "comment": "", + "type": "none" + } + ], + "packageName": "@visactor/lark-vchart" +} \ No newline at end of file diff --git a/common/changes/@visactor/react-vchart/fix-issue-251_2023-07-27-14-40.json b/common/changes/@visactor/react-vchart/fix-issue-251_2023-07-27-14-40.json new file mode 100644 index 0000000000..87449179c5 --- /dev/null +++ b/common/changes/@visactor/react-vchart/fix-issue-251_2023-07-27-14-40.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/react-vchart", + "comment": "", + "type": "none" + } + ], + "packageName": "@visactor/react-vchart" +} \ No newline at end of file diff --git a/common/changes/@visactor/taro-vchart/fix-issue-251_2023-07-27-14-40.json b/common/changes/@visactor/taro-vchart/fix-issue-251_2023-07-27-14-40.json new file mode 100644 index 0000000000..d1ddb0ab5d --- /dev/null +++ b/common/changes/@visactor/taro-vchart/fix-issue-251_2023-07-27-14-40.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/taro-vchart", + "comment": "", + "type": "none" + } + ], + "packageName": "@visactor/taro-vchart" +} \ No newline at end of file diff --git a/common/changes/@visactor/vchart/fix-issue-251_2023-07-27-14-40.json b/common/changes/@visactor/vchart/fix-issue-251_2023-07-27-14-40.json new file mode 100644 index 0000000000..fbebf8c918 --- /dev/null +++ b/common/changes/@visactor/vchart/fix-issue-251_2023-07-27-14-40.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vchart", + "comment": "fix(indicator): add `specKey` for Indicator to fix the issue that the indicator text does not display after the update, close#251", + "type": "patch" + } + ], + "packageName": "@visactor/vchart" +} \ No newline at end of file diff --git a/packages/vchart/src/component/indicator/indicator.ts b/packages/vchart/src/component/indicator/indicator.ts index 8b97c5f1e1..57d6906d45 100644 --- a/packages/vchart/src/component/indicator/indicator.ts +++ b/packages/vchart/src/component/indicator/indicator.ts @@ -22,6 +22,7 @@ import { transformToGraphic } from '../../util/style'; import type { IVisualScale, IVisualSpecStyle, VisualType, FunctionType } from '../../typings/visual'; export class Indicator extends BaseComponent implements IIndicator { + static speckey = 'indicator'; static type = ComponentTypeEnum.indicator; type = ComponentTypeEnum.indicator; name: string = ComponentTypeEnum.indicator; @@ -50,7 +51,7 @@ export class Indicator extends BaseComponent implements IIndicator { const indicatorSpec = spec.indicator || options.defaultSpec; const indicators: IIndicator[] = array(indicatorSpec) .filter(s => s && s.visible !== false) - .map(s => new Indicator(s, options)); + .map((s, index) => new Indicator(s, { ...options, specIndex: index, specKey: Indicator.speckey })); return indicators; }