Skip to content

Commit 3819d71

Browse files
authored
fix: Fix the issue where lineY cannot be drawn when data is empty (#3013)
1 parent f1017f1 commit 3819d71

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/plots/src/core/utils/transform.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ export const transformOptions = (params: Adaptor) => {
6868
} else {
6969
// annotations
7070
if (isArray(config[key])) {
71+
const isText = config[key].some((item) => item.type === 'text');
7172
config[key].forEach((annotation) => {
7273
children.push(transformConfig({
73-
data: [],
74+
...(isText ? { data: [] } : {}),
7475
tooltip: false,
7576
...annotation
7677
}));

0 commit comments

Comments
 (0)