diff --git a/common/changes/@visactor/vchart/fix-media-query-error_2024-12-19-07-36.json b/common/changes/@visactor/vchart/fix-media-query-error_2024-12-19-07-36.json new file mode 100644 index 0000000000..594b3bd3a2 --- /dev/null +++ b/common/changes/@visactor/vchart/fix-media-query-error_2024-12-19-07-36.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: media query should not throw error when has empty axis, related to #3575\n\n", + "type": "none", + "packageName": "@visactor/vchart" + } + ], + "packageName": "@visactor/vchart", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/packages/vchart/src/plugin/chart/media-query/util/filter.ts b/packages/vchart/src/plugin/chart/media-query/util/filter.ts index e7c3b78ed3..54cd1b3ae4 100644 --- a/packages/vchart/src/plugin/chart/media-query/util/filter.ts +++ b/packages/vchart/src/plugin/chart/media-query/util/filter.ts @@ -130,7 +130,7 @@ export const executeMediaQueryActionFilterType = { const specInfo = infoList[i]; - if (componentTypes.includes(specInfo.type as ComponentTypeEnum)) { + if (specInfo && componentTypes.includes(specInfo.type as ComponentTypeEnum)) { result.modelInfo.push({ ...specInfo, spec: componentSpec