File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,9 @@ export default function annotations(options: { owner: Chart }) {
41
41
return [ [ [ xRange [ 0 ] , 0 ] , [ xRange [ 1 ] , 0 ] ] ]
42
42
}
43
43
} )
44
+ const pathEnter = path . enter ( ) . append ( 'path' )
44
45
path
45
- . enter ( )
46
- . append ( 'path' )
46
+ . merge ( pathEnter )
47
47
. attr ( 'stroke' , '#eee' )
48
48
. attr ( 'd' , line as any )
49
49
path . exit ( ) . remove ( )
@@ -61,9 +61,13 @@ export default function annotations(options: { owner: Chart }) {
61
61
}
62
62
]
63
63
} )
64
+ const textEnter = text . enter ( ) . append ( 'text' )
65
+
64
66
text
65
- . enter ( )
66
- . append ( 'text' )
67
+ . merge ( textEnter )
68
+ . text ( function ( d ) {
69
+ return d . text
70
+ } )
67
71
. attr ( 'y' , function ( d ) {
68
72
return d . hasX ? 3 : 0
69
73
} )
@@ -79,9 +83,6 @@ export default function annotations(options: { owner: Chart }) {
79
83
. attr ( 'transform' , function ( d ) {
80
84
return d . hasX ? 'rotate(-90)' : ''
81
85
} )
82
- . text ( function ( d ) {
83
- return d . text
84
- } )
85
86
text . exit ( ) . remove ( )
86
87
87
88
// enter + update
You can’t perform that action at this time.
0 commit comments